def advance(self, error=None):
# uh oh
if error is not None:
log.error('State.advance() threw an exception. %s', error)
# if we are looping and have a song to loop, don't pop the queue. instead, make a ffmpeg source
# and play that.
if self.looping and self.to_loop:
log.debug('Bypassing State.advance() logic, looping %s.', self.to_loop['url'])
self.play(
VolumeTransformer(FFmpegPCMAudio(self.to_loop['url']))
)
return
# out of sources in the queue -- oh well.
if not self.queue:
log.debug('Out of queue items.')
return
# get the latest source in the queue, then play it.
next_up = self.queue.pop(0)
self.play(next_up)
评论列表
文章目录