Skip to content

Instantly share code, notes, and snippets.

@hatsunea

hatsunea/WasapiCaptureRT.cs Secret

Created Jan 13, 2021
Embed
What would you like to do?
private void InitializeCaptureDevice(IAudioClient audioClientInterface)
{
var audioClient = new AudioClient((IAudioClient)audioClientInterface);
if (waveFormat == null)
{
var mix = audioClient.MixFormat;
if (mix is WaveFormatExtensible)
{
if (mix.BitsPerSample == 32)
{
waveFormat = WaveFormat.CreateIeeeFloatWaveFormat(mix.SampleRate, mix.Channels);
}
else
{
waveFormat = new WaveFormat(mix.SampleRate, mix.BitsPerSample, mix.Channels);
}
}
}
:
:
:
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment