Dim path As String = "(wavファイルがある場所)" '再生を始める。 My.Computer.Audio.Play(path)
Dim player As New System.Media.SoundPlayer Dim path As String = "(wavファイルがある場所)" '再生を始める。 player.Play(path)
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _ (ByVal LpstrCommand As String, ByVal LpstrReturnString As String, _ ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer Dim path As String = "(wavファイルがある場所)" Private Sub PlaySound() 'ファイルを開く。 mciSendString("open """ & path & """", "", 0, 0) '再生を始める。 mciSendString("play """ & path & """", "", 0, 0) End Sub