def _get_stream(self,start=False,callback=None):
"""
"""
if callback is None:
def callback(in_data, frame_count, time_info, status):
data = self.wf.readframes(frame_count)
return (data, pyaudio.paContinue)
self.stream = self.pa.open(format=self.pa.get_format_from_width(self.wf.getsampwidth()),
channels=self.wf.getnchannels(),
rate=self.wf.getframerate(),
output=True,
output_device_index=self.device_index,
start=start,
stream_callback=callback)
评论列表
文章目录