Hi..
Anybody know how to play a MP3 file in C. Is there any header files available for it ? Is it a complex task. What should i know in order to play a MP3 file ? Suggest me please....
The easiest way to go about doing that is to convert the mp3 file to a wav file to avoid having to import the AudioX library to your program which may require additional work. Here is the code I came up with that worked on a video game i developed.
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
char* declaredVariable = "C:\\nameOfSong.wav";
/*where declaredVariable can be name of song or whatever and C:\\ should lead to the directory where your audio file has been stored*/
int main()
{
sndPlaySound(declaredVariable, SND_ASYNC);
return 0;
}
It doesnt get much easier than this.