I'm following the AudioPlaybackPanel.cs code and convert it to VB 2010 but just can't make the Spectrum to work. I mean, the PreVolumeMeter never fires
I can play, pause, stop, move the position with a slider, read the position.. just can't make the Spectrum to work
Ths is the code I use:
Dim waveOutDevice As IWavePlayer
Dim mp3Reader As Mp3FileReader
Dim inputStream As WaveChannel32
Dim WithEvents waveChannel As SampleChannel
Dim archivo As String
' ----------
waveOutDevice = New WaveOut()
mp3Reader = New Mp3FileReader(archivo)
inputStream = New WaveChannel32(mp3Reader)
waveChannel = New SampleChannel(mp3Reader, True)
waveOutDevice.Init(inputStream)
waveOutDevice.Play()
' the event
Private Sub waveChannel_PreVolumeMeter(ByVal sender As Object, ByVal e As NAudio.Wave.SampleProviders.StreamVolumeEventArgs) Handles waveChannel.PreVolumeMeter
WaveformPainter1.AddMax(e.MaxSampleValues(0))
WaveformPainter2.AddMax(e.MaxSampleValues(1))
End Sub