I'm programing a playlist player in python using spotify and is running in Raspberry Pi. Everything is great just the songs have pauses during the playback. I done everything, update, check de ALSA driver, the code, I overclocking the raspberry, change the output between analog/HDMI, prefetch the song, but just still having pauses.
What am I doing wrong?
def player(session):
end_of_track = threading.Event()
global volume_effect
track = tracks[0]
def on_end_of_track(self):
end_of_track.set()
session.on(spotify.SessionEvent.END_OF_TRACK, on_end_of_track)
logger.info('End Track Event On')
session.player.prefetch(track)
session.player.load(track)
session.player.play()
logger.info('Playing: %r and %r', track.name, track.duration)
tracks.rotate(1)
logger.info('Next Song: %r', tracks[0].name)
if volume_effect == False:
for v in range(volume_min, volume_max, 5):
mixer.setvolume(int(v))
time.sleep(2)
volume_effect = True
try:
while not end_of_track.wait(track.duration/1000):
pass
except KeyboardInterrupt:
pass
else:
end_of_track.clear
session.player.unload()
player(session)
Aucun commentaire:
Enregistrer un commentaire