how to play MP3 files

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

Hi,

I need to play MP3 files from my .NET 2.0 SP1 C# WinForm app.

I tried referencing Microsoft.DirectX.AudioVideoPlayback; and creating Audio
class for playback. But I get the following error which is beyod my ability
to comprehend.

[
DLL
'C:\WINDOWS\assembly\GAC\Microsoft.DirectX\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.dll'
is attempting managed execution inside OS Loader lock. Do not attempt to run
managed code inside a DllMain or image initialization function since doing
so can cause the application to hang.
]

How do I do this. Please help.

- Andrew
 
Try using creating an instance of the Windows Media Player ActiveX object. If
you Google for something along those lines, you should find plenty of
examples.
If you have troubles with the implementation, I recommend you start by
embedding it in a form, then create and use it exclusively in code.
 
Back
Top