mirror of
https://github.com/DarthAffe/KeyboardAudioVisualizer.git
synced 2025-12-12 23:28:30 +00:00
Added something (a workaround?) to prevent problems with fake 7.1 drivers
This commit is contained in:
parent
51213e31c2
commit
1af8bb67c3
@ -1,4 +1,5 @@
|
|||||||
using CSCore;
|
using CSCore;
|
||||||
|
using CSCore.CoreAudioAPI;
|
||||||
using CSCore.SoundIn;
|
using CSCore.SoundIn;
|
||||||
using CSCore.Streams;
|
using CSCore.Streams;
|
||||||
|
|
||||||
@ -28,7 +29,11 @@ namespace KeyboardAudioVisualizer.AudioCapture
|
|||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
_capture = new WasapiLoopbackCapture();
|
MMDevice captureDevice = MMDeviceEnumerator.DefaultAudioEndpoint(DataFlow.Render, Role.Console);
|
||||||
|
WaveFormat deviceFormat = captureDevice.DeviceFormat;
|
||||||
|
_capture = new WasapiLoopbackCapture(100, new WaveFormat(deviceFormat.SampleRate, deviceFormat.BitsPerSample, deviceFormat.Channels <= 2 ? deviceFormat.Channels : 2));
|
||||||
|
|
||||||
|
//_capture = new WasapiLoopbackCapture();
|
||||||
_capture.Initialize();
|
_capture.Initialize();
|
||||||
_soundInSource = new SoundInSource(_capture) { FillWithZeros = false };
|
_soundInSource = new SoundInSource(_capture) { FillWithZeros = false };
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user