Closed RonaldAJ closed 2 years ago
The pull request #11 also enables the following use of wavinfo using a filehandle:
from wavinfo import WavInfoReader
wavfile = open('mywavfile.wav','rb')
wir = WavInfoReader(wavfile)
print(f'format: {wir.fmt}, frame_count: {wir.data.frame_count}')
Pull request is accepted. Problem solved.
I have a soundfile in memory which I received over a socket as a bytestring: data. Calling io.BytesIO(data) I can convert this to a filehandle like streamobject.
I would like to pass this to wavinfo like this:
and then process the output:
The changes needed to make this possible are modest, see pull request: #11 and keep the filename based functionality untouched.
While working on this it turned out that the repr function was not functional due to mixing of old and new style string formatting. In the pull request it is changed to new style string formatting.