On Tue, 2 Sep 2003 13:56:15 -0500, "Jakub Dudek" <ja*****@yahoo.com>
wrote:
Hi,
I am trying to read wave date (the 16 bits audio words) from a wave file
using c++. I have tried using the mmsystems library. I got to the point
where I read the wave data chunk into a character array using mmioread.
This array does not make much sense to me however, I don't really understand
the format. Anyone has an idea as to how to extract the 16 bit words from
the character array returned by mmioread?
Standard C++ does not include an mmsystems library. You would be better
off posting questions related to it in a newsgroup more closely related
to the compiler or operating system which provides this library.
Alos, any other suggestion as to how to extract wave data (and put it
for example in an array of ints) from a wav file is appreciated
When I needed to do this, years ago, I just found myself a copy of the
..wav spec and wrote my own simple I/O based parser (using only standard
C++ no less). It's basically a matter of understanding the header so
that you know how many bits there are per sample, and whether it is mono
or stereo, and then you just read into your array. My job was a little
easier because I could guarantee that the waves were all in a particular
subset of the spec, but it wouldn't have been much harder to handle the
entire spectrum. It's really a pretty simple format.
--
Greg Schmidt (gr***@trawna.com)
Trawna Publications (
http://www.trawna.com/)