]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
aifc.py: framerate should be an int.
authorSjoerd Mullender <sjoerd@acm.org>
Fri, 28 Jan 1994 09:56:05 +0000 (09:56 +0000)
committerSjoerd Mullender <sjoerd@acm.org>
Fri, 28 Jan 1994 09:56:05 +0000 (09:56 +0000)
sunau.py: should convert number of frames correctly to number of bytes
when reading.

Lib/aifc.py
Lib/sunau.py

index 11dcfe564dbe46ac1eb114f5aa75289dd2345d09..653dac922604f7c9981c05854235d13fcc04dca3 100644 (file)
@@ -515,7 +515,7 @@ class Aifc_read:
                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 :-(
index 7ce74b5c267e827f414d5585e3511e0257ffdd79..17fa60d4301396fba38f8431297faff7e85e9a4b 100644 (file)
@@ -254,7 +254,7 @@ class Au_read:
                        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)