Today I was trying to make simple C# application to display real-time volume of system sound. I have success with NAudio library using this code:
var enumerator = new MMDeviceEnumerator();
var device = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console);
while (true)
{
Console.Write("\r{0}", device.AudioMeterInformation.MasterPeakValue);
}
// Output: 0,2314617
The problem is that I want to get audio volume of each speaker of my 7.1 audio system instead of master volume, so the output will look like:
Speaker1: 0,435462
Speaker2: 0,237462
Speaker3: 0,535962
Speaker4: 0,335862
Speaker5: 0,835462
Speaker6: 0,635462
Speaker7: 0,335462
Subwoofer: 0,236562
Is there any way I can do it? If there is a way can you provide an example?
PeakValues
instead ofMasterPeakValue
. – Roman R.