我用Python编写了一个程序,可以从外部声卡读取数据流。从我的mac电脑上,我可以连接到44.1、48、96、192&;384 kHz而没有任何问题,但是在Windows平台上只能以44.1 kHz连接。,所有其他采样率导致[errno-9997]采样率不正确
Audacity的快速测试表明,可以以更高的采样率连接到设备。
有人能帮我解决这个问题吗?
audio_format = pyaudio.paInt16 device_channels = devices[device]['maxInputChannels'] # Open the selected audio input device stream = p.open( format=audio_format, channels=device_channels, rate=sample_rate, input=True, output=False, input_device_index=device, frames_per_buffer=chunk_size)
在我的mac上,该程序在所有采样率下都能完美工作,但在windows上的表现不同。