PDA

Click to See Complete Forum and Search --> : Stopping a WAV from playing


Bananafish
Jan 3rd, 2001, 06:23 AM
I am writing an application that plays sound, using the "playsound" api. When playing sounds it uses the "loop/async" flags.

Is there a way of stopping the current sound from playing without playing the same sound again?

I have thought of recording a silent WAV file - but this seems over the top. I have played with the SND_PURGE flag - but can't seem to get it to work.

Thanks

Bananafish
Jan 5th, 2001, 03:54 AM
Well I've just answered my own question. I did need SND_PURGE after all but it didn't work quite as I thought.

This did NOT work...

playsound "", 0&, SND_PURGE

Nor did this...

dim strTemp as string
strTemp = ""
playsound strTemp, 0&, SND_PURGE

However, this did...

dim strTemp as string
playsound strTemp, 0&, SND_PURGE

I guess I was wrong in thinking that "" was a "null" string...

jovton
Jan 5th, 2001, 05:52 PM
if you want null values, you can use the vbNull keyword.

thnx.

Bananafish
Jan 8th, 2001, 03:06 AM
thanks