1

I use the following [Visual Basic .NET] code to play an audio file:

Dim waveoutdevice As NAudio.Wave.IWavePlayer = New NAudio.Wave.WaveOut
Dim mainoutputstream As NAudio.Wave.WaveStream
Dim volumestream As NAudio.Wave.WaveChannel32mainoutputstream = CreateInputStream("C:\music\song.mp3")
waveoutdevice.Init(mainoutputstream)
waveoutdevice.Play()

That works. But I don't know how to make a volume peak meter. I've searched all over the internet but I can't find anything useful for me. Can somebody please help me? :)

Captain64
  • 11
  • 3

1 Answers1

0

There are several peak meter examples in the NAudio demo code. For example AudioPlaybackPanel uses a MeteringSampleProvider to generate the peaks to pass to a peak meter control. If you have access to PluralSight, there is a module in my NAudio course that explains in more detail how this code works.

Mark Heath
  • 48,273
  • 29
  • 137
  • 194