I have a python script that plays some audio files with mplayer. This is how I call mplayer in the code:
subprocess.call(["mplayer","-msglevel","all=-1",audiofile])
it works fine if I run the script in foreground... However if I run the script in background like
sudo python script.py &
I cannot get any audio... why? How to fix it?