pyaudio_driver.py 文件源码

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

项目:untwist 作者: IoSR-Surrey 项目源码 文件源码
def callback(self, in_data, count, time_info, status):
                import numpy as np
                input = np.fromstring(in_data, dtype=np.float32).astype(
                    types.float_)
                input_frames = len(input) / self.num_channels
                input = np.reshape(input, (input_frames, self.num_channels))
                np.vstack((self.signal,input))
                if (self.pos + count) >= self.total_frames:
                    status = pa.paComplete
                    print("recording done")
                    if self.stop_func: self.stop_func()
                else:
                    status = pa.paContinue
                    self.pos += count
                return (None, status)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号