reading wave file data

J

Jakub Dudek

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?

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

Thanks for your time
Jakub
 
G

Greg Schmidt

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top