def __init__(self, pa):
self.pa = pa
self.event = threading.Event()
self.wav = wave.open(os.path.join(PIANO_PATH, 'c1.wav'), 'rb')
self.stream = self.pa.open(format=pyaudio.paInt16,
channels=self.wav.getnchannels(),
rate=self.wav.getframerate(),
output=True,
# start=False,
# output_device_index=1,
frames_per_buffer=CHUNK_SIZE,
stream_callback=self._callback)
评论列表
文章目录