I\'m looking for the easiest way to play a MP3 file in C. I am looking for either a library, in which I could just call the function on the filename, or an executable that w
If you are on Windows or OSX, I recommend BASS (http://www.un4seen.com/bass.html)
You can download the library and look at code sample to get started. The "contest" example in C directory is a good start point.
alternatively something someone's already written that will just run and quit.
You can use mpg123 (or the fixed point port of it, mpg321)
mpg123 <mp3file>
will play an mp3 file and quit.
The BASS DLL is really easy to use and will probably do what you need. It is only free for non-commercial use though.
If you need more control, you will need a codec (I prefer libMad) and some sound output API like DirectSound on Windows or ALSA or Linux (or whatever Linux guys use for sound this week)
On Win32, you don't need any library. Use standard Win32 api (mp3 is native)
See on Adv. Win32 api newsgroup : news://comp.os.ms-windows.programmer.win32 where it 's a FAQ.