Even more secrets [man://mpg321] mpg321 "Remote control" mode. Useful for front-ends. Allows seeking and pausing of mp3 files. See README.remote (in /usr/share/doc/mpg321 on Debian and some other systems.)

Thank you but I have read most of the documentation on this already. My script is within an infinite while loop and I cannot have mpg321 stalling the script. So I have a "system("mpg321 song.mp3 &"); line that lets it play in the background without stopping the script. I know that backticks will return a value but in my case I have to wait for the song to be finished playing so I am unsure how to pull these values from the terminal.