Issue #16685: Added support for writing any bytes-like objects in the aifc,

sunau, and wave modules.
This commit is contained in:
Serhiy Storchaka 2013-11-16 14:01:31 +02:00
parent 7714ebbe0e
commit 452bab4acf
8 changed files with 51 additions and 0 deletions

View file

@ -435,6 +435,8 @@ class Wave_write:
return self._nframeswritten
def writeframesraw(self, data):
if not isinstance(data, (bytes, bytearray)):
data = memoryview(data).cast('B')
self._ensure_header_written(len(data))
nframes = len(data) // (self._sampwidth * self._nchannels)
if self._convert: