Results 1 to 2 of 2

Thread: Sound

  1. #1
    Guest

    Question

    How can you add some sound to your VB program.?

  2. #2
    Guest
    Use the PlaySound API function.

    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 WAV
        PlaySound "C:\MyFile.wav", 0&, &H1
    
    End Sub
    
    
    Private Sub Command2_Click()
    
        'Stop WAV
        PlaySound "C:\MyFile.wav", 0&, &H4
    
    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