set Volume for mp3 playback

Mar 14, 2012 at 12:45 PM
Edited Mar 14, 2012 at 12:46 PM

class AudioFileReader has Volume property, but class Mp3FileReader doesn't have such property. (I use Mp3FileReader for playback from Stream).

Another property IWavePlayer.Volume is obsolete, so how can I change Volume (and toggle mute on/off) for mp3 playing?

Mar 14, 2012 at 3:17 PM

AudioFileReader just chains together a bunch of IWaveProviders and ISampleProviders and uses Mp3FileReader under the covers.

In the very latest NAudio code I added a WaveVolumeProvider16 for cases when you want to change the volume without going to floating point.

Also, although IWavePlayer.Volume is obsolete (since not all output models will support it), if you are using WaveOut then you can set the Volume property on that.