I am trying to use ffmpeg and alsa to play a single mp3 file.

Here is the code I have, thus far. I'm using global variables just as a way to get this working for now.

I can play pcm wav files using alsa with some other code I wrote, and can read the mp3 information using ffmpeg, so my problem is getting the mp3 stream information read and decoded into something alsa can understand.

Here is a pastebin with my code in it. The playsound() function starts are line 241
My pastebin code

Any help is most appreciated!