Index: wave.py =================================================================== --- wave.py +++ wave.py @@ -149,6 +149,8 @@ """ def initfp(self, file): + # assume PCM initially + self._wavformat = WAVE_FORMAT_PCM self._convert = None self._soundpos = 0 self._file = Chunk(file, bigendian = 0) @@ -303,6 +305,9 @@ self._sampwidth = (sampwidth + 7) // 8 self._sampformat = self._formattag | (self._sampwidth<<8) + if self._formattag == WAVE_FORMAT_IEEE_FLOAT: + self._wavformat = WAVE_FORMAT_IEEE_FLOAT + if self._formattag == WAVE_FORMAT_IEEE_FLOAT and chunk.getsize() > 16: extFmtsize = struct.unpack_from(' 0: @@ -443,7 +448,7 @@ def setparams(self, params): if len(params) == 6: nchannels, sampwidth, framerate, nframes, comptype, compname = params - wavformat = WAVE_FORMAT_PCM + self._wavformat = WAVE_FORMAT_PCM elif len(params) == 7: nchannels, sampwidth, framerate, nframes, comptype, compname, wavformat = params else: