I have written a program in Python which reads a stream of data from an external sound card. From my mac computer I can connect to the sound card at 44.1, 48, 96, 192 & 384 kHz without any issues, however on the Windows platform it is only possible to connect at 44.1 kHz., all other sample rates result in [errno -9997] Incorrect sample rate
Quick test with Audacity shows it is possible to connect to the device at higher sample rates.
Can anyone help me with this problem?
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)
On my mac the program works perfectly at all sample rates but it behaves differently on windows.