1audio = pyaudio.PyAudio()
2stream = audio.open(format=FORMAT, channels=CHANNELS, rate=RATE, output=True, frames_per_buffer=CHUNK)
3
4try:
5 while True:
6 data = s.recv(CHUNK)
7 stream.write(data)
8except KeyboardInterrupt:
9 pass