Solved

Playing .wav -files from C(++)

Posted on 1998-08-18
3
178 Views
Last Modified: 2012-05-04
I am a little bit new to C++( although I know the basic skills). What I 'd like to do is playing a .wav - file from without C++.
0
Comment
Question by:TomX
3 Comments
 
LVL 6

Expert Comment

by:snoegler
ID: 1170629
What os/compiler are you using?
0
 
LVL 6

Accepted Solution

by:
WxW earned 100 total points
ID: 1170630
If it is a windows application you have many ways to play a wav file . If you just want to play it , call sndPlaySound() as follows :

BOOL sndPlaySound(LPCTSTR lpszSound,UINT fuSound)

for example sndPlaySound("C:\\MEDIA\\MYWAVE.WAV",SND_SYNC)
This will play your wav and wait until it has finished . SND_ASYNC does the work asynchronously . If you want more details on managing wav's , lemme know :)
0
 
LVL 1

Expert Comment

by:jdyer
ID: 1170631
PlaySound also will work, and provides a little more control over how it is played

Regards,
 jdyer
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now