How to play MP3 in c#

hi everyone, please help me.

i already refered a lot documents and samples to tell me how to

play a mp3 file in c#.but these files only tell me how to play a file.

actually i already downloaded the mp3 file and save to a byte array

so i need to play the content of the mp3 file in byte array.

of course i can save the data to file then play it,but because of some

other reasons i can not do it in this way.i must play directly from array

not from a file. i hope you can give me some tips,to provide source code is better,more detail more better.

thanks a lot



Answer this question

How to play MP3 in c#

  • *George*

    Take a look at this and see if it helps:

    http://www.codeproject.com/cs/media/cswavplay.asp df=100&forumid=13779&exp=0&fr=26&select=736865

    The thing I dont understand is that what problems are you facing if you play the mp3 directly

    You can launch or embed WMP10 (using the WMP10SDK) in your application and then tell it to play the file through that, or you could use the DirectX SDK to play audio via DirectX in your application.

    hope it helps!



  • zgueney

    A good way to play mp3s from c# is using the lame library or you can use MCI:


  • invc

    yes,when i played the mp3 directly i got trouble.

    if there is a mp3 file such as c:\a.mp3,i can play it no problem.

    but now i already downloaded the content of the mp3 file from host.

    i use a byte array to save these data.i can save these data to a file such as c:\b.mp3 then i can play it.but because of other reasons i can not do

    it in this way.i must play these data from array directly.


  • Dean S.

    why dont you just stream it and play it in WMP embedded

  • ryanmm1

    I made a wrapper over Audiere.

    http://audiere.sf.net

    Check it out is a very nice library.


  • How to play MP3 in c#