Hello everybody,
I need to encode a wav file to another file format (pcm). This format has to following properties: 8kHz, 16-bit. Has anybody an idea how to do this in c# or vb?
Thank you in advance, JaQ
Hello everybody,
I need to encode a wav file to another file format (pcm). This format has to following properties: 8kHz, 16-bit. Has anybody an idea how to do this in c# or vb?
Thank you in advance, JaQ
I am not sure exactly what you want to do. WAV files are (usually) just wrappers around uncompressed pcm data.
But, whether you want to access the data, or write out RAW header-less PCM files, you can use libsndfile. I found some c# sample code on the ArsTechnica forums.
RE: Daniel Brückner's Answer
The author of libsndfile also wrote libsamplerate, which can simplify resampling.
A uncompressed Wave files contains plain PCM data plus some meta data - you can find a description here at Wotsit.org. If the sampling rates, resolutions, and number of channels match, you can just strip of the meta data. If they do not match, you will have to resample the Wave file, but this is not a trivial task, if you want it done right (Downsampling requires low-pass filtering the data in order to avoid aliasing because of the Nyquist–Shannon sampling theorem and both - upsamping and downsampling - require good interpolation - idealy sinc interpolation.