Results 1 to 5 of 5

Thread: play a sound file??

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

    play a sound file??

    How do I play a sound file in my program??

    Simple I am sure...

    Please be detailed...

    Thanks,

    Anjari

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Through COM Interop, you could use the windows media player ocx component.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

    ummm

    Hehe please explain a little more..

    Anjari

  4. #4
    Member JesusFreak's Avatar
    Join Date
    Feb 2003
    Location
    Headed for Heaven
    Posts
    57
    Right Click the toolbox and select cosomize toolbox.
    Click on the Com Components tab and scroll down to the bottom were it says "Windows Media Player".
    Click the check box beside it and click ok.
    At the bottom of the toolbox their sould now be the Windows Media Player control.
    That if you confess with your mouth, "Jesus is Lord," and believe in your heart that God raised him from the dead, you will be saved.

  5. #5
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    API will work too:

    VB Code:
    1. Private Declare Auto Function PlaySound Lib "winmm.dll" (ByVal ByVallpszSoundName As String, ByVal hModule As Integer, ByVal dwFlags As Integer) As Integer
    2.  
    3. SUB...etc
    4.  
    5.         Dim pathtofile As String = "c:\test.wav"
    6.         Dim fileName As String = String.Concat(pathtofile)
    7.         Const SND_FILENAME As Integer = &H20000
    8.  
    9.         PlaySound(fileName, 0, SND_FILENAME)
    10.  
    11. end sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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