I recorded a radio signal into a .wav, I can open it in audacity and see that there is binary data encoded using a开发者_C百科 certain algorithm. Does anyone know of a way to process the signal that is contained within the .wav? so that i can extract the binary data from it?
I know that I need to know the encoding algorithm for it to work properly, anyone know of any program that does something like that?
Thanks
sox will convert most audio formats to most other audio formats - including raw binary.
The .wav format is generally very simple and wav files usually don't have compressed data. It's quite feasible to parse it yourself, but much easier to use something already made. So the short answer is to find something that can read wav files in your language of choice.
Here's an example in Python, using the wave module:
import wave
w = wave.open("myfile.wav", "rb")
binary_data = w.readframes(w.getnframes())
w.close()
Now where you go depends on what else you want to do. binary_data
is now a python string of the raw bytes. If you just want to chop this and repackage it, it's probably easiest to leave it in this form. If you want to manipulated the data, such as scale it, interpolate, filter, etc, you would probably want to convert this into a sequence of numbers, and for this, in Python, you'd want to convert it to a numpy array. You could do this yourself using the struct module, which is for interpreting strings as packed binary data, or you could just have read in the data using scipy.io.wave module which does this for you. As you can see, most of this becomes fairly language dependent quickly.
精彩评论