state.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:dogbot 作者: slice 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号