On Windows, the audio captured (through build_input_stream) seems to be passed through a default audio filter. I thought I had a bug in my code, because the sound recorded by cpal kept cutting out. This was particularly strange because sound from the same microphone in other apps that also didn't use exclusive mode (e.g. Discord) was fine. This issue did not happen on Linux. I found out that this issue was that Windows does audio processing by default. I did some further digging, and it seems that cpal does not use the IAudioClient2::SetClientProperties, which allows the AUDCLNT_STREAMOPTIONS_RAW flag to be set.
On Windows, the audio captured (through
build_input_stream) seems to be passed through a default audio filter. I thought I had a bug in my code, because the sound recorded bycpalkept cutting out. This was particularly strange because sound from the same microphone in other apps that also didn't use exclusive mode (e.g. Discord) was fine. This issue did not happen on Linux. I found out that this issue was that Windows does audio processing by default. I did some further digging, and it seems thatcpaldoes not use theIAudioClient2::SetClientProperties, which allows theAUDCLNT_STREAMOPTIONS_RAWflag to be set.