[.net] playing mp3 files

Started by
2 comments, last by GameDev.net 17 years, 6 months ago
How can i play mp3 files (songs) with C# and .Net? Thanks.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
Advertisement
I think that you might want to read this thread first. You might end up not wanting to play MP3s any more.

But if you really want to, this might be worth looking at, though I've never used it myself.
FMODex has .NET headers and also will play mp3s out of the box. Quite easy to use.
For basic playback, you could add quartz.dll (somewhere in system32 folder) to your references and then do the following.

QuartzTypeLib.FilgraphManager graphManager = new QuartzTypeLib.FilgraphManager();
graphManager.RenderFile("c:\\mysong.mp3");
graphManager.Run();
Console.ReadLine();
graphManager.Stop();

This topic is closed to new replies.

Advertisement