Exemple #1
0
 /// <summary>
 /// Initialises a new instance of SampleChannel
 /// </summary>
 /// <param name="waveProvider">Source wave provider, must be PCM or IEEE</param>
 /// <param name="forceStereo">force mono inputs to become stereo</param>
 public SampleChannel(IWaveProvider waveProvider, bool forceStereo)
 {
     ISampleProvider sampleProvider = SampleProviderConverters.ConvertWaveProviderIntoSampleProvider(waveProvider);
     if (sampleProvider.WaveFormat.Channels == 1 && forceStereo)
     {
         sampleProvider = new MonoToStereoSampleProvider(sampleProvider);
     }
     this.waveFormat = sampleProvider.WaveFormat;
     // let's put the meter before the volume (useful for drawing waveforms)
     this.preVolumeMeter = new MeteringSampleProvider(sampleProvider);
     this.volumeProvider = new VolumeSampleProvider(preVolumeMeter);
 }
Exemple #2
0
        /// <summary>
        /// Initialises a new instance of SampleChannel
        /// </summary>
        /// <param name="waveProvider">Source wave provider, must be PCM or IEEE</param>
        /// <param name="forceStereo">force mono inputs to become stereo</param>
        public SampleChannel(IWaveProvider waveProvider, bool forceStereo)
        {
            ISampleProvider sampleProvider = SampleProviderConverters.ConvertWaveProviderIntoSampleProvider(waveProvider);

            if (sampleProvider.WaveFormat.Channels == 1 && forceStereo)
            {
                sampleProvider = new MonoToStereoSampleProvider(sampleProvider);
            }
            this.waveFormat = sampleProvider.WaveFormat;
            // let's put the meter before the volume (useful for drawing waveforms)
            this.preVolumeMeter = new MeteringSampleProvider(sampleProvider);
            this.volumeProvider = new VolumeSampleProvider(preVolumeMeter);
        }