diff --git a/Lib/aifc.py b/Lib/aifc.py index 11dcfe564db..653dac92260 100644 --- a/Lib/aifc.py +++ b/Lib/aifc.py @@ -515,7 +515,7 @@ def _read_comm_chunk(self, chunk): self._nchannels = _read_short(chunk) self._nframes = _read_long(chunk) self._sampwidth = (_read_short(chunk) + 7) / 8 - self._framerate = _read_float(chunk) + self._framerate = int(_read_float(chunk)) self._framesize = self._nchannels * self._sampwidth if self._aifc: #DEBUG: SGI's soundeditor produces a bad size :-( diff --git a/Lib/sunau.py b/Lib/sunau.py index 7ce74b5c267..17fa60d4301 100644 --- a/Lib/sunau.py +++ b/Lib/sunau.py @@ -254,7 +254,7 @@ def readframes(self, nframes): if nframes == AUDIO_UNKNOWN_SIZE: data = self._file.read() else: - data = self._file.read(nframes * self._sampwidth * self._nchannels) + data = self._file.read(nframes * self._framesize * self._nchannels) if self._encoding == AUDIO_FILE_ENCODING_MULAW_8: import audioop data = audioop.ulaw2lin(data, self._sampwidth)