Most mp3 de- and encoding libraries have functions for it. You don't have to do the low-level work then (otherwise you wouldn't require the lib ;-) )
If you want to encode, liblame is a good choice.
For decoding I use mpeglib...
If you just want to play audio-data, you can use the SDL or something like this:
Code:
pid_x=fork();
if(!pid_x)
{
stdin=freopen("/dev/null","r+",stdin);
stdout=freopen("/dev/null","w+",stdout);
stderr=freopen("/dev/null","w+",stderr);
execlp("/usr/bin/mpg123","/usr/bin/mpg123","/path/to/your/mp3/file.mp3",NULL);
printf("Error: Unable to execute the player!\n");
exit(1);
}
Easy but nice solution used in many apps :-)