DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: playing a wav file

  1. #1
    cal Guest

    playing a wav file


    I have VB6 and I am trying to attach a wav file to a command button, so when
    the button is pushed, a
    sound will be played. Any one know how to do it?


    thanks
    cal

  2. #2
    Jim F Guest

    Re: playing a wav file

    Private Declare Function PlaySound Lib "winmm.dll" _
    Alias "PlaySoundA" (ByVal lpszName As String, _
    ByVal hModule As Long, ByVal dwFlags As Long) As Long

    Private Const SND_FILENAME = &H20000 ' Name is a file name.


    'Selected is a choice I make from

    Private Sub mnuChooseSoundItem_Click()

    CommonDialog1.Filter = "WaveFiles (*.WAV)|*.WAV"
    CommonDialog1.ShowOpen

    Selected = CommonDialog1.FileName

    End Sub

    ' the following in the event procedure

    Call PlaySound(Selected, 0, SND_FILENAME)



    cal <sticks2@earthlink.net> wrote in message
    news:39ef7b82$1@news.devx.com...
    >
    > I have VB6 and I am trying to attach a wav file to a command button, so

    when
    > the button is pushed, a
    > sound will be played. Any one know how to do it?
    >
    >
    > thanks
    > cal




  3. #3
    cal Guest

    Re: playing a wav file


    Jim---I could not get the code to work.


    thanks
    cal
    >
    >


    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center