By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,888 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,888 IT Pros & Developers. It's quick & easy.

reading wave file data

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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/)
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.