- Код: Выделить всё
Imports Microsoft.DirectX
Imports Microsoft.DirectX.DirectSound
Public Class Main
' Объявление переменных DirectSound
Private DirectSound_Device As DirectSound.Device
Private DirectSound_SecondaryBuffer As DirectSound.SecondaryBuffer
Private Sub Main_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' Инициализация DirectSound
DirectSound_Device = New DirectSound.Device
DirectSound_Device.SetCooperativeLevel(Me, CooperativeLevel.Priority)
DirectSound_SecondaryBuffer = New SecondaryBuffer("C:\Windows Logon Sound.wav", DirectSound_Device)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DirectSound_SecondaryBuffer.Play(0, BufferPlayFlags.Default)
End Sub
End Class
Вот на этой строке
- Код: Выделить всё
DirectSound_SecondaryBuffer = New SecondaryBuffer("C:\Windows Logon Sound.wav", DirectSound_Device)
Раньше, такого не было. Что я делаю неправильно.