Results 1 to 4 of 4

Thread: Stopping a WAV from playing

  1. #1

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394

    Unhappy

    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



  2. #2

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    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...


  3. #3
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266

    Cool

    if you want null values, you can use the vbNull keyword.

    thnx.
    jovton

  4. #4

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394

    Cool

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width