wavio
wavio copied to clipboard
Lacks BytesIO support
Python typically has it so BytesIO can be a 'placeholder' for an open file (both for read and write operations), especially if tasks are to be written in-memory rather than written to disk. Many standard python file operations will accept a BytesIO object in the place of a file, for example, in PIL:
from PIL import Image
SomeBinaryData = b'Placeholder'
with Image.open(io.BytesIO(SomeBinaryData)) as LoadedImage:
#some normal file operations go here
Passing a BytesIO object to wavio.write in-place of a filepath currently throws an error.
Given many numpy operations will be in-memory, it would be reasonable to assume any .wav manipulation (E.G. by pydub) would also likely be in-memory too, prior to file export. BytesIO support would readily enable this and doesn't require much overhead to implement.