Results 1 to 2 of 2

Thread: Sounds

  1. #1

    Thread Starter
    Lively Member Skateboarder's Avatar
    Join Date
    Nov 2000
    Location
    Delfzijl, the Netherlands
    Posts
    66

    Arrow

    He you guys, I'm gettin' better everyday in VB. How do I play wav files in VB without using the mediaplayer or any other program for it?
    To VB or not to VB, that's the question...

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'Play A sound
    
    '
    'API Function to play the sound
    'bas module code
    
    Declare Function PlaySound Lib "winmm.dll" _
    Alias "PlaySoundA" (ByVal lpszName As String, _
    ByVal hModule As Long, ByVal dwFlags As Long) As Long 
    
    
    'form code
    
    Private Sub Command1_Click()
        'Play wav
        PlaySound "C:\A Wayne\YourFile.wav", 0&, &H1
    End Sub
    
    Private Sub Command2_Click()
        'Stop wav
        PlaySound "C:\A Wayne\YourFile.wav", 0&, &H4
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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