Search code examples
c#audionaudio

NAudio get Left and Right speaker levels?


I'm currently fetching the master level fine with this:

MMDeviceEnumerator devEnum = new MMDeviceEnumerator();
MMDevice defaultDevice = devEnum.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia);
Console.WriteLine("Sending Volume level through " + port.PortName);
Console.WriteLine("\rCurrent Level: " + defaultDevice.AudioMeterInformation.MasterPeakValue.ToString());

But is it possible to get the Left and Right levels from all sound passing through?

I've looked around and have not found anything on this.


Solution

  • Nevermind, Found out its:

    defaultDevice.AudioMeterInformation.PeakValues[0] // left defaultDevice.AudioMeterInformation.PeakValues[1] // right