I have raw data of .wav format audio and I am trying to convert it to file object but it seems the decoding is not happening.
How do I decode .wav audio raw data format?
Python Code:
>>> import io
>>> audio_raw_data = b'RIFF\xe4\x99\x19\x00WAVEfmt \x10\x00\x00\x00'
>>> type(audio_raw_data)
<class 'bytes'>
>>> audio_file = io.StringIO(audio_raw_data.decode())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 4-5: invalid continuation byte