[Help]compiled audio[Solved]

Posts 1–5 of 5 · Page 1 of 1
[Help]compiled audio[Solved]
does anybody know how to play compiled .wav files in VB.net?
been looking and the the life of me can not find/work it out....
[php]Public Class Sound
Declare Auto Function PlaySound Lib "winmm.dll" (ByVal name _
As String, ByVal hmod As Integer, ByVal flags As Integer) As Integer

Declare Auto Function PlaySound Lib "winmm.dll" (ByVal name _
As Byte(), ByVal hmod As Integer, ByVal flags As Integer) As Integer

Public Const SND_SYNC = &H0 ' play synchronously

Public Const SND_ASYNC = &H1 ' play asynchronously

Public Const SND_MEMORY = &H4 'Play wav in memory

Public Const SND_ALIAS = &H10000 'Play system alias wav

Public Const SND_NODEFAULT = &H2
Public Const SND_FILENAME = &H20000 ' name is file name

Public Const SND_RESOURCE = &H40004 ' name is resource name or atom

...
End Class

'Using the code:


Private Sub btnFile_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnFile.Click
'File Located in executable dir, change it if you need

Sound.PlayWaveFile("sn01088a.wav")
End Sub

Private Sub btnEmbed_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnEmbed.Click
'Remeber to include the wave in the project

'and then in the "build action"

'properties set it as: "Embedded Resource"

Sound.PlayWaveResource("The Microsoft Sound.wav")
End Sub

Private Sub btnSystem_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSystem.Click

'Here some ...


'"SystemQuestion"

'"SystemExclaimation"

'"SystemHand"

'"Maximize"

'"MenuCommand"

'"MenuPopup"

'"Minimize"

'"MailBeep"

'"Open"

'"Close"

'"SystemAsterisk"

'"RestoreUp"

'"RestoreDown"

'"SystemExit"

'"SystemStart"


Sound.PlayWaveSystem("SystemExit")
End Sub[/php]

Leeched from CodeProject(first link on google )
dude...im adding you to credits....any credits for any program that i use this...


Code:
My.Computer.Audio.Play("Filename.wav")

OR

Code:
My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Beep)
Marked Solved
Refrain from posting unless < 7 days & necessary
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?