-
-
Save hatsunea/0579ff8a673980fd605985f5d9d5a5cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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