I can't get the visual basic volume meter to work
I'm using windows 8 and 10 with visual studio 2013 and tried this code
after adding the reference naudio.dll and naudio core api to the project :
I'm using windows 8 and 10 with visual studio 2013 and tried this code
after adding the reference naudio.dll and naudio core api to the project :
Imports NAudio
Imports NAudio.CoreAudioApi
Public Class Form1
Private de As New MMDeviceEnumerator
Private volume As Double
Private volumelast As Double
Private change As Double
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim device As MMDevice = de.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Multimedia)
volume = device.AudioMeterInformation.MasterPeakValue * 100
Label1.Text = volume
End Sub
End Class
I only get the value 0 in the label, and yes the mic is set as the default audio device.








