Closed benlin1996 closed 3 years ago
What do you mean by the .raw file?
You need to find out data type
and sample rate
of the audiofile, in advance.
If .raw is the 16bit 16kHz PCM
, you can load it as:
import numpy as np
x = np.fromfile('xxx.raw', dtype=np.int16) / 32768.0
Thanks for your help, I will try your method
Thanks for the wonderful code. In your example, I guess it is for .wav file. But for the audio in .raw, is this function still valid? And what is the correct reading function for .raw file.
Thanks for your help.