gui.py 文件源码

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

项目:high-quality-chat 作者: b6938236 项目源码 文件源码
def request_file(self, obj):
        """
        Called upon when the user requests a file by clicking "Request" on a recording.
        :param obj: ToggleButton object
        :return: None
        """
        role = self.app.config.get('ChatSettings', 'role')
        if role == 'ARTIST':
            # Get filename of the high quality clip associated with this play button
            filename = self.app.get_own_state()['audio_files'][obj.clip_no]
            _, tail = os.path.split(filename)
            # Get base name
            # root, _ = os.path.splitext(tail)

            # Get filename of the session high quality audio stream
            hq_audio = self.app.config.get_file_name(self.app.session_name, tail)
            print "Requesting {}".format(tail)
            # Send a sync message to request a file.
            self.app.chat_client.send_sync(constants.SYNC_REQUEST_FILE,
                                           filename=tail)

        elif role == 'PRODUCER':
            self.app.chat_client.send_sync(constants.SYNC_REQUEST_FILE, filename=obj.filename)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号