0

hey guys! i've been getting better at vb.net and i am very familiar with it now. im not an expert but i know some more vb.net now. anyway, i have some code here:

'Show status
        txtboxStatus.Text = "Playing Loading Sound"
        'Play recording
        Me.BackgroundWorker1.RunWorkerAsync()

    End Sub

    'This method is executed in a worker thread.
    Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
        'Perform some time-consuming operation here.
        My.Computer.Audio.Play(My.Resources.Sounds.email, AudioPlayMode.WaitToComplete)
        Threading.Thread.Sleep(250)
    End Sub

    'This method is executed in the UI thread.
    Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
        txtboxStatus.Text = "Ready"

    End Sub

what i want to do is make a function for the audio play that can ajust volume. so something like this:

My.Computer.Audio.Play(My.Resources.Sounds.email, AudioPlayMode.WaitToComplete)
My.Computer.Audio.Volume = trkbrVolume.Value

before i had this code:

Imports System.Media

Dim sndPing As New SoundPlayer(My.Resources.Sounds.email)
sndPing.Play()
sndPing.Volume = trkbrVolume.Value

but i want to have the audioplaymode.waittocomplete and volume at the same time. Can u help???
thx!!!

2
Contributors
2
Replies
6
Views
4 Years
Discussion Span
Last Post by Programmer629
1

The Audio class does not supports volumen manipulation.
See on this link for a Nuget Audio Package.

Hope this helps

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.