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)
评论列表
文章目录