11# @autor: Magno Efren
22# Youtube: https://www.youtube.com/c/MagnoEfren/
3- #Reproductor de Musica
3+ # Reproductor de Musica
44
55from tkinter import Button , Label ,Tk ,filedialog , ttk , Frame , PhotoImage
66import pygame
77import random
88import mutagen
99
1010#from mutagen.mp3 import MP3
11-
1211#pygame.mixer.pre_init(frequency=44100)
12+
1313pygame .mixer .init ()
1414pygame .mixer .init (frequency = 44100 )
1515cancion_actual = ''
@@ -76,14 +76,13 @@ def iniciar_reproduccion():
7676 tt = minutos * 60 + segundos
7777 tiempo ['maximum' ]= tt # tiempo total de la cancion
7878 texto ['text' ]= str (minutos ) + ":" + str (segundos )
79-
79+
8080 actualizar = ventana .after (100 , iniciar_reproduccion )
8181
8282 if x == tt :
8383 ventana .after_cancel (actualizar )
8484 texto ['text' ]= "00:00"
8585 detener_efecto ()
86-
8786 if pos != n :
8887 pos = pos + 1
8988 ventana .after (100 , iniciar_reproduccion )
@@ -93,7 +92,6 @@ def iniciar_reproduccion():
9392
9493def iniciar ():
9594 global cancion_actual
96-
9795 pygame .mixer .music .load (cancion_actual )
9896 pygame .mixer .music .play ()
9997 iniciar_reproduccion ()
@@ -143,21 +141,15 @@ def stop():
143141 global actualizar
144142 pygame .mixer .music .stop ()
145143 ventana .after_cancel (actualizar )
146- detener_efecto ()
147-
148-
144+ detener_efecto ()
149145def pausa ():
150146 global actualizar
151147 pygame .mixer .music .pause ()
152148 ventana .after_cancel (actualizar )
153149 detener_efecto ()
154-
155-
156150def continuar ():
157151 pygame .mixer .music .unpause ()
158152 ventana .after (100 , iniciar_reproduccion )
159-
160-
161153ventana = Tk ()
162154ventana .title ('Reproductor de Musica' )
163155ventana .iconbitmap ('icono.ico' )
0 commit comments