sound.py 文件源码

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

项目:APEX 作者: ymollard 项目源码 文件源码
def __init__(self):
        self.rospack = RosPack()
        with open(join(self.rospack.get_path('apex_playground'), 'config', 'environment.json')) as f:
            self.params = json.load(f)

        with open(join(self.rospack.get_path('apex_playground'), 'config', 'bounds.json')) as f:
            self.bounds = json.load(f)["sensory"]["sound"][0]

        self.p = pyaudio.PyAudio()
        self.fs = 44100       # sampling rate, Hz, must be integer
        self.duration = 1./self.params['rate']

        # for paFloat32 sample values must be in range [-1.0, 1.0]
        self.stream = self.p.open(format=pyaudio.paFloat32,
                                  channels=1,
                                  rate=self.fs,
                                  output=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号