Results 1 to 2 of 2

Thread: someone help

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Location
    Launceston, Tasmania, Australia
    Posts
    6

    Post

    If asked this question before I know but I really need to be able to play sounds on Vb3

    can someone please help me with a code? anyone?

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    You can use sndPlaySound API.

    Code:
    Private Declare Function sndPlaySound Lib "WinMM.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    Private Const SND_ASYNC = &H1
    Private Const SND_NODEFAULT = &H2
    Private Const SND_FLAG = SND_ASYNC Or SND_NODEFAULT
    
    
    Public Sub PlayWav(pWavFile As String)
        If Dir(pWavFile) <> "" Then
            Call sndPlaySound(pWavFile, SND_FLAG)
        End If
    End Sub
    Usage: PlayWav WaveFileName
    Example: PlayWav "C:\MiFile.wav"

    Regards,

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819


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