I believe that the best to do this and that is also compatible with Python 3.x is:
https://pypi.python.org/pypi/mplayer.py/
I highly recommend that you look at Darwin M. Bautista's git or google code:
And here is an example from (as provided by him):
from mplayer import Player, CmdPrefix
# Set default prefix for all Player instances
Player.cmd_prefix = CmdPrefix.PAUSING_KEEP
# Since autospawn is True by default, no need to call player.spawn() manually
player = Player()
# Play a file
player.loadfile('mp3_filename')
# Pause playback
player.pause()
# Get title from metadata
metadata = player.metadata or {}
print metadata.get('Title', '')
# Print the filename
print player.filename
# Seek +5 seconds
player.time_pos += 5
# Set to fullscreen
player.fullscreen = True
# Terminate MPlayer
player.quit()
List of supported audio codecs:
- MPEG layer 1, 2, and 3 (MP3) audio
- AC3/A52, E-AC3, DTS (Dolby Digital) audio (software or SP/DIF)
- AAC (MPEG-4 audio)
- WMA (DivX Audio) v1, v2
- WMA 9 (WMAv3), Voxware audio, ACELP.net etc (using x86 DLLs)
- RealAudio: COOK, SIPRO, ATRAC3 (using Real libraries)
- RealAudio: DNET and older codecs
- QuickTime: Qclp, Q-Design QDMC/QDM2, MACE 3/6 (using QT libraries), ALAC
- Ogg Vorbis audio
- VIVO audio (g723, Vivo Siren) (using x86 DLL)
- alaw/ulaw, (ms)gsm, pcm, *adpcm and other simple old audio formats