Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

kalok

How can I use VC++ to play a WAV file?

This topic is 5612 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
You can use OpenAl library..this is the link http://www.openal.org/home/

It include several examples and a sdk.

Share this post


Link to post
Share on other sites
PlaySound

The PlaySound function plays a sound specified by the given filename, resource, or system event. (A system event may be associated with a sound in the registry or in the WIN.INI file.)

Share this post


Link to post
Share on other sites
Thank you.

The PlaySound function is very nice.

But how can I play a wav file continuously or stop playing a wav file?

Share this post


Link to post
Share on other sites
I wrote this a long time ago and since then I no longer use winshit but for your need it seems perfect.

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=3855&lngWId=3

Its a hole media engine that can even play more then wav files(mp3s wma midi ect). So you can use it in your engine just give me credit for the media part

Share this post


Link to post
Share on other sites
I tried the following statement, the it did not play repeatly, just once, why?


PlaySound("sound.wav",NULL,SND_LOOP);

Share this post


Link to post
Share on other sites
although the statement PlaySound("c:\windows\media\chime.wav", NULL, SND_LOOP|SND_ASYNC); works, but the program can not be quitted, I have to power off my PC every time.

Share this post


Link to post
Share on other sites
At the risk of being impertinent -

You know, I''ve advised you... how many times now?... to read the documentation. If you were capable of following advice, you''d have read that passing NULL as the file name stops the noise.

I probably shouldn''t tell you that. I like the mental image of a frustrated pinhead re-booting his machine because it''s incessantly chiming...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!