Search code examples
c#audiovolumenaudio

How can I use volumeSlider in NAudio?


I'm using NAudio library for audio player project. I want to make user control volume-slider like here

Is there anyone who knows how to use volume-slider in NAudio?


Solution

  • The NAudioDemo project included in the source code includes an example of using this slider. Handle the VolumeChanged event on the VolumeSlider, and then use the Volume property to set the volume either on a stream (e.g. the Volume property on SampleChannel), or directly on the output device (e.g. WaveOut)