Uvádím tu pro jistotu celý kód:
Imports Microsoft.DirectX
Imports Microsoft.DirectX.DirectSound
Public Class Form1
Public Dev As Device = New Device
Public snd As Buffer
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dev.SetCooperativeLevel(Me.Handle, CooperativeLevel.Priority)
snd = New Buffer("c:zvuk.mp3", Dev)
snd.Play(0, BufferPlayFlags.Default)
End Sub
End Class
A vyhodilo to tuhle výjimku: Microsoft.DirectX.DirectSound.SoundException was unhandled ErrorCode=-2147287038 ErrorString="Unknown" IsExceptionIgnored=False LastError=2 Message="Chyba v aplikaci." Source="Microsoft.DirectX.DirectSound" StackTrace: v Microsoft.DirectX.DirectSound.Buffer.CreateBufferFomFile(String fileName, BufferDescription desc, Device parent) v Microsoft.DirectX.DirectSound.Buffer..ctor(String fileName, Device parent) ****** Budu velice vděčný moudré bytosti, která mi pomůže najít řešení.
|