Po spuštění následujícího kódu dojde k výjimce a to po zavolání s.SetEffects(efekty):
ErrorMessage = "DSErr_Usrunavail"
Imports Microsoft.directx
Imports Microsoft.DirectX.DirectSound
Public Class Form1
Public dev As Device
Public s As SecondaryBuffer
Public bufdesc As BufferDescription
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
dev = New Device
dev.SetCooperativeLevel(Me, CooperativeLevel.Priority)
bufdesc = New BufferDescription
bufdesc.ControlEffects = True
s = New SecondaryBuffer("d:eliška.wav", bufdesc, dev)
Dim efekty(1) As EffectDescription
efekty(0).GuidEffectClass = DSoundHelper.StandardEchoGuid
s.seteffects(efekty)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
s.Play(0, BufferPlayFlags.Looping)
End Sub
End Class
|