大家好,我有一个用 vb.net 制作的宾果游戏。我的 D: 文件夹中录制了声音。我每次绘制一个数字和字母时都会播放它,但是每当我关闭游戏表格然后从菜单中重新开始一个新游戏时,声音就不再播放了。该程序确实通过了我制作的声音功能但它不播放声音。这是我的代码:
Sub sound()
If lblletter.Text <> "" And lblNumber.Text <> "" And lbllang.Text = "English" Then
Dim sound As String = "D:\BINGO BONANZA\ENGLISH\" + lblletter.Text + " " + lblNumber.Text + ".wav"
If My.Computer.FileSystem.FileExists(sound) Then
My.Computer.Audio.Play(sound, AudioPlayMode.Background)
Else
MsgBox("No sound file for this")
End If
ElseIf lblletter.Text <> "" And lblNumber.Text <> "" And lbllang.Text = "English" Then
Dim sound As String = "D:\BINGO BONANZA\FILIPINO\" + lblletter.Text + " " + lblNumber.Text + ".wav"
If My.Computer.FileSystem.FileExists(sound) Then
My.Computer.Audio.Play(sound, AudioPlayMode.Background)
Else
MsgBox("No sound file for this")
End If
End If
End Sub