PyAudio - How mix wave file into a continuous stream
问题 I want to write a very basic application that passes audio from microphone to speakers. This is very simple with pyaudio as described on https://people.csail.mit.edu/hubert/pyaudio/ . def passthrough(): WIDTH = 2 CHANNELS = 1 RATE = 44100 p = pyaudio.PyAudio() def callback(in_data, frame_count, time_info, status): return (in_data, pyaudio.paContinue) stream = p.open(format=p.get_format_from_width(WIDTH), channels=CHANNELS, rate=RATE, input=True, output=True, stream_callback=callback) stream