We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

[280] Play a WAV file

Last post 08-04-2003 3:31 PM by HyperHacker. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [280] Play a WAV file

    This thread is for discussions of Play a WAV file.

    • Post Points: 0
  • 11-04-2002 3:14 PM In reply to

    • Niecole
    • Not Ranked
    • Joined on 10-31-2002
    • Junior Member
    • Points 165

    Got an Error

    SND_FLAG

    this Variable is not defined it says....Now What?
    • Post Points: 0
  • 01-10-2003 9:34 AM In reply to

    • todiverge
    • Not Ranked
    • Joined on 01-10-2003
    • United States
    • New Member
    • Points 5

    Re: Got an Error

    Values for the SND_FLAG variable are defined in the MMSYSTEM.H file (found in the C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include folder on my machine.)

    The following variables are defined:
    /*
    *  flag values for fuSound and fdwSound arguments on [snd]PlaySound
    */
    #define SND_SYNC            0x0000  /* play synchronously (default) */
    #define SND_ASYNC           0x0001  /* play asynchronously */
    #define SND_NODEFAULT       0x0002  /* silence (!default) if sound not found */
    #define SND_MEMORY          0x0004  /* pszSound points to a memory file */
    #define SND_LOOP            0x0008  /* loop the sound until next sndPlaySound */
    #define SND_NOSTOP          0x0010  /* don't stop any currently playing sound */

    I recommend setting the variable to 1 (SND_ASYNC) -- this allows the program to continue executing while the sound file is playing in the background, instead of waiting for the sound clip to finish.

    Good luck.  
    • Post Points: 0
  • 01-27-2003 3:13 AM In reply to

    • Blobby66
    • Not Ranked
    • Joined on 01-27-2003
    • New Member
    • Points 5

    SND_FLAG

       Private Const SND_FLAG = &H1 Or &H2
    • Post Points: 0
  • 08-04-2003 3:31 PM In reply to

    Haha, funny side effect

    I tried it, and it won't stop... VB itself keeps playing the file until I close it. What you can do to stop it is Call PlayWav(vbnullstring) - playing a nonexistant file will stop any current file.
    Now, anyone know how to tell how much is loaded, and how to play an MP3 this way (IE without a Windoze Media Control)?
    • Post Points: 0
Page 1 of 1 (5 items)