none
Obtener en una Label el tanto % de volumen

Respuestas

  • ' /r:naudio.dll ' https://naudio.codeplex.com/ Imports NAudio.CoreAudioApi Public Class Form1 Delegate Sub EscribeVolumen(vol As String) Dim volParlante As AudioEndpointVolume Dim Volumen As EscribeVolumen Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim de As New MMDeviceEnumerator Dim d As MMDevice = de.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia) volParlante = d.AudioEndpointVolume AddHandler volParlante.OnVolumeNotification, AddressOf CambiaVolumen Label1.Text = CInt(volParlante.MasterVolumeLevelScalar * 100).ToString Volumen = New EscribeVolumen(AddressOf labelVolumen)

            'volParlante.MasterVolumeLevelScalar = 1 ' valores entre 0 y 1
            'volParlante.Mute = True End Sub Sub CambiaVolumen(data As AudioVolumeNotificationData) Invoke(Volumen, CInt(volParlante.MasterVolumeLevelScalar * 100).ToString) End Sub Sub labelVolumen(texto As String) Label1.Text = texto End Sub Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing volParlante.Dispose() End Sub End Class


    domingo, 2 de octubre de 2016 1:11