import vlc class Player: def __init__(self): self.player = vlc.MediaPlayer() def play(self): self.player.play() def stop(self): self.player.stop() def pause(self): self.player.pause() def setPlaybackRate(self, rate): self.player.set_rate(rate) def getPlaybackRate(self): return self.player.get_rate() def setPlaybackPosition(self, position): self.player.set_position(position) def getPlaybackPosition(self): return self.player.get_position() def setPlaybackVolume(self, volume): self.player.audio_set_volume(int(volume * 100)) def getPlaybackVolume(self): return self.player.audio_get_volume() / 100.0 def setCurrentSong(self, path): media = vlc.Media(path) self.player.set_media(media)