Answer the question
In order to leave comments, you need to log in
Not playing mp3 through pyglet?
Good afternoon, comrades)
Please help a newbie)
I'm trying to play mp3 using the pyglet package, initially I want to write the most primitive alarm clock algorithm, don't judge strictly for the shitty code, if there is one, I'm a beginner and I'm writing from the knowledge that I have , better indicate if where I screwed up specifically)
But that's not the point, here's the code on the question:
from datetime import datetime
import time
import pyglet
hours = str(input("Enter Hours: "))
minutes = str(input("Enter Minutes: "))
timesum = hours + ':' + minutes
def play_song():
song = pyglet.media.load('1.mp3')
song.play()
pyglet.app.run()
def clock():
timenow = datetime.now().time()
timeredirect = str(timenow)
timeneed = timeredirect[0:5]
if timesum != timeneed:
time.sleep(1)
return clock()
else:
play_song()
return
clock()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question