I would like change the volume of my audiostream in runtime. I use this code: Public Volume as Single = 0.01 Dim Wave1 As New NAudio.Wave.WaveOut
Dim xa() As Byte = IO.File.ReadAllBytes("C:\Song - Come Out and Play.wav")
Sub PlaySound()
Dim data As New IO.MemoryStream(xa)
Wave1.Init(New NAudio.Wave.BlockAlignReductionStream(NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(New NAudio.Wave.WaveFileReader(data))))
Wave1.Volume = Volume
Wave1.Play()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PlaySound()
End Sub
But how can i change the Volume in runtime? It doesn´t change, when i click a button with
Volume = 2.0
Why?
Thanks for this.
Second problem: How must i change this code, to play MP3 instead of WAV? Because WAV is to large..
Thanks for both :)
Sorry for my bad English.
Regards, René :)