Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Declare Auto Function PlaySound Lib "winmm.dll" _
(ByVal lpszSoundName As String, ByVal hModule As Integer, _
ByVal dwFlags As Integer) As Integer
Private Const SND_FILENAME As Integer = &H20000
Public sub PlayWav(ByVal fileFullPath As String)
Dim iRet As Integer = 0
Try
iRet = PlaySound(fileFullPath, 0, SND_FILENAME)
Catch
End Try
End Function
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 [COLOR=green]' play synchronously [/color]
Public Const SND_ASYNC = &H1 [COLOR=green]' play asynchronously [/color]
Public Const SND_MEMORY = &H4 [COLOR=green]'Play wav in memory[/color]
Public Const SND_ALIAS = &H10000 [COLOR=green]'Play system alias wav [/color]
Public Const SND_NODEFAULT = &H2
Public Const SND_FILENAME = &H20000 [COLOR=green]' name is file name [/color]
Public Const SND_RESOURCE = &H40004 [COLOR=green]' name is resource name or atom [/color]
...
End Class
Private Sub btnFile_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnFile.Click
[COLOR=green]'File Located in executable dir, change it if you need[/color]
Sound.PlayWaveFile("sn01088a.wav")
End Sub
Private Sub btnEmbed_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnEmbed.Click
[COLOR=green]'Remeber to include the wave in the project
'and then in the "build action"
'properties set it as: "Embedded Resource"[/color]
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
[COLOR=green] 'Here some ...
'"SystemQuestion"
'"SystemExclaimation"
'"SystemHand"
'"Maximize"
'"MenuCommand"
'"MenuPopup"
'"Minimize"
'"MailBeep"
'"Open"
'"Close"
'"SystemAsterisk"
'"RestoreUp"
'"RestoreDown"
'"SystemExit"
'"SystemStart"[/color]
Sound.PlayWaveSystem("SystemExit")
End Sub
That's from version 2.0 of the .NET framework which is still in beta. You can't use that in version 1.1.My.Computer.Audio.Play(My.Resources.Intro, AudioPlayMode.Background)