Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: simple example to control volume using NAudio

$
0
0
Thank you for the suggestion, here is the code that is functional for creating the wave player:
            m_WavePlayer = new WaveOut();
            m_AudioFileReader = new AudioFileReader(strFullPath);
            m_VolSampleProvider = new VolumeSampleProvider(m_AudioFileReader);
            m_VolSampleProvider.Volume = Volume;
            m_SmplToWaveProvider = new SampleToWaveProvider(m_VolSampleProvider);
            m_WavePlayer.Init(m_SmplToWaveProvider);
And then the volume can dynamically change using this:
            if (m_VolSampleProvider != null)
                m_VolSampleProvider.Volume = value;
Interestingly, the VolumeSampleProvider and SampleToWaveProvider don't have Dispose() methods. I'm wondering if I have a memory leak ?

Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>