Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

playing WAVE FILE

Hi there.

I need to play a wave file inside a VB.NET routine.
Does anyone help me with some sample code piece?

I'd prefer to use .NET component or native instruction.

Thanks in advance.
Bye.
0
Kupi
Asked:
Kupi
  • 2
2 Solutions
 
Ignacio Soler GarciaSolution Architech & Technical LeadCommented:
0
 
planoczCommented:


    Public Const SND_SYNC = &H0                     'play synchronously (default)
    Public Const SND_NODEFAULT = &H2                'silence not default, if sound not found

    Private Declare Ansi Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long


   Public Sub OpenWave(ByVal sVoicefile As String)
        Dim x As Long
        Dim sPath As String = "C:\MYPATH\"
        x = sndPlaySound(sPath & sVoicefile, SND_SYNC Or SND_NODEFAULT)
    End Sub

Example: OpenWave("C:\Hi.wav")
0
 
planoczCommented:
Hi Kupi,

Have you fix your problem with wave files?
0
 
KupiAuthor Commented:
Thanks for your help!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now