1.参照ライブラリNAudio、Gitのアドレス https://github.com/naudio/NAudio
2.次のコードと参照を追加します。
公共フロートGetVoicePeakValue()
{
=新しいMMDeviceEnumerator VAR列挙子()。
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)。
selectedDevice.AudioMeterInformation.MasterPeakValueを返します。
}