Read wave file audio data
How do I read the wave file audio data into a buffer?
I want to play the audio data using alsa/asoundlib
snd_pcm_writei(handle , buffer , 2 * period_size);
where "buffer" is my buffer containing the sound data
# 1 Re: Read wave file audio data
A wave file is a binary file with audioinformation and a header (the first x nr of bits) describing the exact format.
So, you find out what the header looks like, interpret it yourself, or you use some library to open a wave file.
Wave file header info can be found in external links here:
http://en.wikipedia.org/wiki/WAV
Personally I like the STK (http://ccrma.stanford.edu/software/stk/) library to read a wave file and generate buffers of data, and for realtime audio output.
Or you can find source code + explanation if you search for "wave file c++ (http://www.google.com/search?q=wave+file+c%2B%2B)"
ejac at 2007-11-9 1:24:52 >
