Skip to content

Commit 5659d1c

Browse files
authored
Update main.py
1 parent 6c18f23 commit 5659d1c

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Reproductor de Musica/main.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# @autor: Magno Efren
22
# Youtube: https://www.youtube.com/c/MagnoEfren/
3-
#Reproductor de Musica
3+
# Reproductor de Musica
44

55
from tkinter import Button, Label,Tk,filedialog, ttk, Frame, PhotoImage
66
import pygame
77
import random
88
import mutagen
99

1010
#from mutagen.mp3 import MP3
11-
1211
#pygame.mixer.pre_init(frequency=44100)
12+
1313
pygame.mixer.init()
1414
pygame.mixer.init(frequency=44100)
1515
cancion_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

9493
def 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()
149145
def pausa():
150146
global actualizar
151147
pygame.mixer.music.pause()
152148
ventana.after_cancel(actualizar)
153149
detener_efecto()
154-
155-
156150
def continuar():
157151
pygame.mixer.music.unpause()
158152
ventana.after(100 , iniciar_reproduccion)
159-
160-
161153
ventana =Tk()
162154
ventana.title('Reproductor de Musica')
163155
ventana.iconbitmap('icono.ico')

0 commit comments

Comments
 (0)