DirectX AudioVideoPlayback: LoaderLock
-
Written an app to play some sounds for me, in time with a text file I've got displayed. Uses Microsoft.DirectX.AudioVideoPlayback (April 07 SDK I believe) and consists of an array of 7 Audio objects, where each is set to a particular file by the following:
Imports DXAV = Microsoft.DirectX.AudioVideoPlayback
Dim audioTracks(7) As DXAV.Audio
Private Sub SetSound(ByVal trackID As Byte, ByVal soundName As String)
Dim soundFullName As String = soundPath & soundName & soundExt ' Builds full filename
If IO.File.Exists(soundFullName) Then
audioTracks(trackID) = New DXAV.Audio(soundFullName)
Else
MsgBox("File not found: " & soundFullName & ".", MsgBoxStyle.Exclamation)
End If
End SubThe actual play/stop actions are simply
audioTracks(trackID).Play()
andStop()
calls. However, when I run this, theaudioTracks(trackID) = New DXAV.Audio(soundFullName)
fails because: DLL 'C:\..dahdahdah..\Microsoft.DirectX.dll' is attempting managed execution inside OS Loader lock. I've seen LoaderLocks when using multi-threaded apps with calls to Me.Controls but my app is single-threaded.Ninja (the Nerd)
Confused? You will be...