954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Playing a wav sound from program

I am at a lvl between beginner and intermeddiate with C++, and I can't figure out how to play a wav sound from a C++ program... I search it on google and all the code I look at doesn't make any sense to me. Can someone plz help me to understand how to play a wav file from a directory from a C++ console application? By the way im more used to using int main() instead of int void() or whatever. Thanks!

amerninja2
Light Poster
36 posts since Oct 2008
Reputation Points: 5
Solved Threads: 0
 

Do a google search on PCM wave format header information, then create a struct/class with all the neccessary members that the header contains, plus a dynamic array (vector perhaps) of actual raw wav data. You will then need to find an appropriate library/dll for interpreting the data and sending it to the digital to analog sound converter, and then to the sound bus. It's quite a bit more complex a task then it would seem at first glance.

skatamatic
Posting Shark
959 posts since Nov 2007
Reputation Points: 403
Solved Threads: 129
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You