Results 1 to 4 of 4

Thread: Playing Wave Files in a form

  1. #1
    wehttam13
    Guest

    Cool Playing Wave Files in a form

    I've figured out how to play sound through windows media player within a form, but i don't know how to send sound directly to the sound driver. If anybody knows, please tell me.
    thnx

  2. #2
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    Playing .wav files

    Type this in a moduel:

    Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
    (ByVal lpszSoundName As Any, ByVal uFlags As Long) As Long
    Const SND_ASYNC = &H1

    Then, in your form. When ever something happens type this:

    sndPlaySound App.Path & "\nameofsoundfile.wav", &H1

    Hope this helps!

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    If you wish for program execution to cease, add SND_SYNC from the constants section of the API viewer and use that for your flag.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    wehttam13
    Guest
    thanks,
    it works for me

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