mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
aifc.py: framerate should be an int.
sunau.py: should convert number of frames correctly to number of bytes when reading.
This commit is contained in:
parent
5125908d2b
commit
ffe9490d79
2 changed files with 2 additions and 2 deletions
|
@ -515,7 +515,7 @@ class Aifc_read:
|
||||||
self._nchannels = _read_short(chunk)
|
self._nchannels = _read_short(chunk)
|
||||||
self._nframes = _read_long(chunk)
|
self._nframes = _read_long(chunk)
|
||||||
self._sampwidth = (_read_short(chunk) + 7) / 8
|
self._sampwidth = (_read_short(chunk) + 7) / 8
|
||||||
self._framerate = _read_float(chunk)
|
self._framerate = int(_read_float(chunk))
|
||||||
self._framesize = self._nchannels * self._sampwidth
|
self._framesize = self._nchannels * self._sampwidth
|
||||||
if self._aifc:
|
if self._aifc:
|
||||||
#DEBUG: SGI's soundeditor produces a bad size :-(
|
#DEBUG: SGI's soundeditor produces a bad size :-(
|
||||||
|
|
|
@ -254,7 +254,7 @@ class Au_read:
|
||||||
if nframes == AUDIO_UNKNOWN_SIZE:
|
if nframes == AUDIO_UNKNOWN_SIZE:
|
||||||
data = self._file.read()
|
data = self._file.read()
|
||||||
else:
|
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:
|
if self._encoding == AUDIO_FILE_ENCODING_MULAW_8:
|
||||||
import audioop
|
import audioop
|
||||||
data = audioop.ulaw2lin(data, self._sampwidth)
|
data = audioop.ulaw2lin(data, self._sampwidth)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue