An MP3 music player interface for Python with builtin playback and queue functionality built using Pygame mixer
Install via pip
$ pip install pymusicplayer
from pymusicplayer import MusicPlayer
mp = MusicPlayer()
add_song(filename, song_name)
- Add song to queue by filename and sets song name (defaults to filename)remove_song(index)
- Remove song at index of queueget_current_song()
- Return name of currently loaded songget_queue()
- Return names of songs in queueget_loop_queue()
- Return if queue will loopset_loop_queue()
- Set if queue should loopshuffle()
- Shuffle songs in queueis_playing()
- Return if music is currently playingplay()
- Start playing loaded musicpause()
- Pause loaded musicrestart()
- Restart loaded musicget_volume()
- Returns volume of musicset_volume(volume)
- Sets volume of music to value in interval [0, 100]get_pos()
- Get current position of loaded music in millisecondsset_pos(pos)
- Set position of loaded music in millisecondschoose_song(index)
- Load song at index in queuenext_song()
- Load next song in queueprevious_song()
- Load previous song in queueskip(amount)
- Skip amount (in milliseconds) in music (positive for forward, negative for rewind)