Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: simple vb.net Naudio volume meter

$
0
0
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 :
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.

Viewing all articles
Browse latest Browse all 5831

Latest Images

Trending Articles



Latest Images