assemble.py 文件源码

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

项目:AssembleAudio 作者: The-White-Wolf 项目源码 文件源码
def load_audio_file(self, path):
        from kivy.core.audio import SoundLoader

        sound = SoundLoader.load(path)
        self._sound = sound

        if sound:
            update_bar_schedule = Clock.schedule_interval(self.update_bar, 1)
            self._update_bar_schedule = update_bar_schedule

            self.ids.p_bar.max = sound.length
            sound.volume = self.ids.volume_slider.value
            sound.play()
        else:
            print('Cannot play the file %s.' % path)
            error_msg = 'Cannot play the file %s.' % (path) if path else 'No file selected.'
            popup = Popup(title='Audio Error.',
                    content=Label(text= error_msg),
                    size_hint = (0.3, 0.3))
            popup.open()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号