Python Forum
Pygame mixer and tkinter music player
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pygame mixer and tkinter music player
#1
Hi,

I want to implement music player in tkinter gui. For some reasons I am not able to use python musicplayer library which needs vc++ environment. So I am using pygame mixer module. Stuck on implementation of music players's seek feature.

The following code implemented in pygame mixer and tkinter can play only ogg formats. How to update so as to play mp3 and wav formats also.

https://stackoverflow.com/questions/5408...elation-to.

When I try to play MP3 the slider works fine for some times but after the music gets stopped playing. The below method is where the problem occurs.

def UpdateSlider( self, value ):
        '''Move slider position when tk.Scale's trough is clicked or when slider is clicked.'''
        print( '\ndef UpdateSlider():' );       print(type(value),'value = ',value,' sec')
        if self.player.music.get_busy():
            print("Track Playing")
            self.after_cancel( self.loopID ) #Cancel PlayTrack loop    
            self.slider_value.set( value )   #Move slider to new position
            self.Play( )                     #Play track from new postion
        else:
            print("Track Not Playing")
            self.slider_value.set( value )   #Move slider to new position
Reply
#2
see: https://pypi.org/search/?q=mp3+wav+player&o=-zscore
you'll have to find one from this list that best fits your needs
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  mute spotify by the mixer of volume garze23 0 280 Feb-27-2024, 05:42 PM
Last Post: garze23
  Pygame player spawn Yegor123 0 924 Nov-05-2022, 10:07 PM
Last Post: Yegor123
  migrate code from tkinter to pygame Frankduc 16 3,159 Jun-01-2022, 12:45 PM
Last Post: Frankduc
  Pygame and tkinter seteg 1 1,508 Feb-14-2022, 12:04 PM
Last Post: dboxall123
  pygame music doesn't work CompleteNewb 1 4,644 Jan-30-2021, 09:25 AM
Last Post: Tyrel
  One Button music player Skjortan 2 2,914 Aug-11-2018, 09:23 AM
Last Post: Skjortan
  Trypng to use pygame mixer Larz60+ 4 3,513 Mar-21-2018, 09:08 PM
Last Post: Larz60+
  Pygame*import pygame ImportError: No module named pygame CASPERHANISCH 1 9,763 Jun-05-2017, 09:50 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020