Sign in to follow this  
loder

sound problemUrgent

Recommended Posts

PlaySound(TEXT("beach2.wav"), NULL, SND_FILENAME); i using above code to play my sound, sound can come out, but the my model cannot show and it lag at there. could anyone please help me see what problem i face now. thanks.

Share this post


Link to post
Share on other sites
To stop the sound that you played with
PlaySound(TEXT("beach2.wav"), NULL, SND_FILENAME|SND_ASYNC);
use PlaySound(NULL,NULL,SND_PURGE);
And here is the full documentation of PlaySound if you need anything else :

http://msdn2.microsoft.com/en-us/library/ms712879.aspx

Sorry for the lousy structure of the reply. I`m new to this forum.

Share this post


Link to post
Share on other sites
Quote:
Original post by nPenAPaT
To stop the sound that you played with
PlaySound(TEXT("beach2.wav"), NULL, SND_FILENAME|SND_ASYNC);
use PlaySound(NULL,NULL,SND_PURGE);
And here is the full documentation of PlaySound if you need anything else :

http://msdn2.microsoft.com/en-us/library/ms712879.aspx

Sorry for the lousy structure of the reply. I`m new to this forum.


u mean i need to put tis code PlaySound(NULL,NULL,SND_PURGE); below PlaySound(TEXT("beach2.wav"), NULL, SND_FILENAME|SND_ASYNC);??

i also new in this forum also.

if i wan the sound looping.so what is the code?? sorry ask u so many question..

thank you.

Share this post


Link to post
Share on other sites
Use PlaySound(NULL,NULL,SND_PURGE); to stop a sound when you want to.
To start a loop use
PlaySound(TEXT("beach2.wav"), NULL, SND_FILENAME|SND_ASYNC|SND_LOOP);
and if you want to stop the loop use PlaySound(NULL,NULL,SND_PURGE);

Share this post


Link to post
Share on other sites
if i use this code to play my sound.

case 'l':
PlaySound(TEXT("linkin2.wav"), NULL, SND_FILENAME|SND_ASYNC);
RenderScene();

then how i put a code to stop it??
and how can i make sure the sound will auto loop??

if i nedd to play different sound, is that posible?

pls help me.
i need to pass up my project monday.

thank you for you help.

Share this post


Link to post
Share on other sites
Quote:
Original post by nPenAPaT
Use PlaySound(NULL,NULL,SND_PURGE); to stop a sound when you want to.
To start a loop use
PlaySound(TEXT("beach2.wav"), NULL, SND_FILENAME|SND_ASYNC|SND_LOOP);
and if you want to stop the loop use PlaySound(NULL,NULL,SND_PURGE);


many many thanks.its help alot.

i use this to play two sound:


case 'l':
PlaySound(TEXT("beach2.wav"), NULL, SND_FILENAME|SND_ASYNC|SND_LOOP);
RenderScene();
break;
case 'j':
PlaySound(TEXT("linkin2.wav"), NULL, SND_FILENAME|SND_ASYNC|SND_LOOP);
RenderScene();
break;
case 'k':
PlaySound(NULL,NULL,SND_PURGE);
RenderScene();
break;

it work perfectly.hehe...you solve my problem.thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this