Results 1 to 4 of 4

Thread: Wave Worries

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    7

    Unhappy

    I'm pretty poor when it comes to VB, so if anyone can give me any (REALLY) basic instructions on how to play a *.wav file after an event occurs, it would be really helpful.

    I tried what Dim suggested:
    Shell("C:\mywave.wav")
    but VB protested with
    "Invalid procedure call or arguement"

    btw, I am using VB 5.0 Enterprise (not by choice, it's for a school project)

    [Edited by SOUL-JAH on 07-17-2000 at 01:43 AM]

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    hehe i knew that woudn't work...here i'm 90% sure this will
    Code:
    'In Gen Decler.
    Private Declare Function Playwave Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    
    Private Sub Command1_Click()
        F = Playwave("C:\abort.wav", 1)
    End Sub
    gl, D!m

    [Edited by Dim on 07-17-2000 at 01:52 AM]
    Dim

  3. #3
    Guest
    You trying to play a wav file? Refer to this thread: http://forums.vb-world.net/showthrea...threadid=23098

    Hope that helps.

  4. #4
    Guest

    Exclamation Use PlaySound

    You should use PlaySound which is the successor to sndPlaySound.

    Code:
    Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
    
    Private Sub Command1_Click()
    
        'Play the WAV
        PlaySound "C:\MyFile.wav", 0&, &H1
    
    End Sub

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