Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ffe9490

Browse files
aifc.py: framerate should be an int.
sunau.py: should convert number of frames correctly to number of bytes when reading.
1 parent 5125908 commit ffe9490

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/aifc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def _read_comm_chunk(self, chunk):
515515
self._nchannels = _read_short(chunk)
516516
self._nframes = _read_long(chunk)
517517
self._sampwidth = (_read_short(chunk) + 7) / 8
518-
self._framerate = _read_float(chunk)
518+
self._framerate = int(_read_float(chunk))
519519
self._framesize = self._nchannels * self._sampwidth
520520
if self._aifc:
521521
#DEBUG: SGI's soundeditor produces a bad size :-(

Lib/sunau.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def readframes(self, nframes):
254254
if nframes == AUDIO_UNKNOWN_SIZE:
255255
data = self._file.read()
256256
else:
257-
data = self._file.read(nframes * self._sampwidth * self._nchannels)
257+
data = self._file.read(nframes * self._framesize * self._nchannels)
258258
if self._encoding == AUDIO_FILE_ENCODING_MULAW_8:
259259
import audioop
260260
data = audioop.ulaw2lin(data, self._sampwidth)

0 commit comments

Comments
 (0)