mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Issue #16685: Added support for writing any bytes-like objects in the aifc,
sunau, and wave modules.
This commit is contained in:
parent
7714ebbe0e
commit
452bab4acf
8 changed files with 51 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue