I'm trying to write a program in C that converts a captured Raw 16kHz PCM 16-bit file to a 16-bit WAV.
I've read some posts and people recommended using libsox
. Installed it and now i'm really struggling with understanding the man-page.
So far (by reading the example in the source dist) I've figured out that the structs
:
- sox_format_t
- sox_signalinfo_t
can probably be used to describe the data I'm inputting. I also know how much info i'm processing (time) if that is somehow necessary?
Some guidance is appreciated!
I would recommend to write WAV header and data manually, it is really very simple for PCM : https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
Well, It worked out as the question is answered. However I'll post the code here so that people can analyze it or just use it in their own projects.
The link provided by both "simonc" and "Nickolay O." was used. Search the web for more info on the individual fields.