C#获取话筒主峰值(实时音频输出分贝量)
2021-02-06 08:14
阅读:544
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;
}
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:C#获取话筒主峰值(实时音频输出分贝量)
文章链接:http://soscw.com/index.php/essay/51653.html
文章标题:C#获取话筒主峰值(实时音频输出分贝量)
文章链接:http://soscw.com/index.php/essay/51653.html
评论
亲,登录后才可以留言!