标签:添加 bsp value rpe def info int tde efault
1.引用类库NAudio,Git地址 https://github.com/naudio/NAudio
2.添加如下代码和引用:
public float GetVoicePeakValue()
{
var enumerator = new MMDeviceEnumerator();
var CaptureDevices = enumerator.EnumerateAudioEndPoints(DataFlow.Capture, DeviceState.Active).ToArray();
var defaultDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Console);
var selectedDevice = CaptureDevices.FirstOrDefault(c => c.ID == defaultDevice.ID);
return selectedDevice.AudioMeterInformation.MasterPeakValue;
}
标签:添加 bsp value rpe def info int tde efault
原文地址:https://www.cnblogs.com/Khan-Sadas/p/11427678.html