예제 #1
0
        public AutoTuneWaveProvider(IWaveProvider source, AutoTuneSettings autoTuneSettings)
        {
            this.autoTuneSettings = autoTuneSettings;
            if (source.WaveFormat.SampleRate != 44100)
                throw new ArgumentException("AutoTune only works at 44.1kHz");
            if (source.WaveFormat.Encoding != WaveFormatEncoding.IeeeFloat)
                throw new ArgumentException("AutoTune only works on IEEE floating point audio data");
            if (source.WaveFormat.Channels != 1)
                throw new ArgumentException("AutoTune only works on mono input sources");

            this.source = source;
            this.pitchDetector = new AutoCorrelator(source.WaveFormat.SampleRate);
            this.pitchShifter = new SmbPitchShifter(Settings);
            this.waveBuffer = new WaveBuffer(8192);
        }
예제 #2
0
        public AutoTuneWaveProvider(IWaveProvider source, AutoTuneSettings autoTuneSettings)
        {
            this.autoTuneSettings = autoTuneSettings;
            if (source.WaveFormat.SampleRate != 44100)
            {
                throw new ArgumentException("AutoTune only works at 44.1kHz");
            }
            if (source.WaveFormat.Encoding != WaveFormatEncoding.IeeeFloat)
            {
                throw new ArgumentException("AutoTune only works on IEEE floating point audio data");
            }
            if (source.WaveFormat.Channels != 1)
            {
                throw new ArgumentException("AutoTune only works on mono input sources");
            }

            this.source        = source;
            this.pitchDetector = new AutoCorrelator(source.WaveFormat.SampleRate);
            // alternative pitch detector:
            // this.pitchDetector = new FftPitchDetector(source.WaveFormat.SampleRate);
            this.pitchShifter = new SmbPitchShifter(Settings, source.WaveFormat.SampleRate);
            this.waveBuffer   = new WaveBuffer(8192);
        }