def music_player(): #function defination mi.init() mu.set_volume(0.7) mu.load(random.choice(songs)) print( "*******************************************************************") print("\t\tWELCOME TO MY MUSIC_PLAYER") print( "*******************************************************************") print("press 'a' to PLAY | press 'r' to RESUME | press 'n' for next song") print("press 's' to STOP | press 'p' to PAUSE") print( "--------------------------------------------------------------------\n" ) while True: query = input("") if query == 'a': mu.play() print("Player Start!") elif query == 'r': mu.unpause() print("Song resume") elif query == 'p': print("song pause!") mu.pause() elif query == 'n': print("Listen next song!") mu.stop() time.sleep(1) mu.load(random.choice(songs)) mu.play() elif query == 's': mu.stop() break print("Player get quit !")
def play(self): if self.is_file_get: if self.song_ptr == -1: self.next_song() elif self.playing: mx.pause() self.playing = False elif not self.playing: mx.unpause() self.playing = True else: showinfo(title="Directory not found", message='Directory is not set')
def togglePlayPause(self, *args): if self.pauseBtn.isVisible(): self.pauseBtn.setVisible(False) self.pauseBtn.setEnabled(False) self.contBtn.setVisible(True) self.contBtn.setEnabled(True) self.playSong.pauseTimeline() # self.playSong.runTime.connect(self.updateTimeline) print "Entered Pause" _mixer.pause() elif self.contBtn.isVisible(): self.contBtn.setVisible(False) self.contBtn.setEnabled(False) self.pauseBtn.setVisible(True) self.pauseBtn.setEnabled(True) self.playSong.dePauseTimeline() # self.playSong.runTime.connect(self.updateTimeline) print "Entered Playing" _mixer.unpause()
def unpauseMusic(): player.unpause()
def unpause(self): mixer_music.unpause()