Results 1 to 3 of 3

Thread: Is there any way to play a .wav w/o using a control?

  1. #1
    Guest

    Post

    Is there?

  2. #2
    Fanatic Member HaxSoft's Avatar
    Join Date
    May 2000
    Location
    Ohio
    Posts
    593
    Try the PlaySound Win API function (winmm.dll) << I think that was the name.

    The API Viewer probably has the declaration for that call.

  3. #3
    Guest
    Code:
    Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    Global Const SND_ASYNC = &H1
    Global Const SND_NODEFAULT = &H2
    
    Sub Playwav(file)
    SoundName$ = file
    wFlags% = SND_ASYNC Or SND_NODEFAULT
    X% = sndPlaySound(SoundName$, wFlags%): NoFreeze% = DoEvents()
    End Sub
    
    Usage:
    Call Playwav("C:\opera.wav")
    you can also stop a wav:
    Call Playwav(" ")
    Hope that helps.



    [Edited by Matthew Gates on 07-17-2000 at 01:57 AM]

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