Results 1 to 3 of 3

Thread: adding sounds to a program

  1. #1
    Guest
    Does anyone know how to add simple sounds to a vb program? right now i am only looking for simple sounds like *.wav sounds i would especially want to play sounds like the defualt windows sounds. If you can help me out or point me in the right direction it would be appreciated.

    thanks
    doug

  2. #2
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    Look up the PlaySound API at either http://www.vbapi.com or in MSDN, it lets you play sounds out of resource files, default windows sounds, and .wav files
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  3. #3
    Guest
    Here is an example of how to 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()
        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