public void SetBufferSize(int samples)
 {
     _portOut.PrepareProcessing(
         10 * samples,
         DefaultParameters.DefaultBufferMilliseconds.ToSamples(_portOut.Samplerate)
         );
 }
Beispiel #2
0
        public override void PrepareProcessing()
        {
            if (_portInp.FFTSize <= 0)
            {
                throw new InvalidOperationException("FFT Size must be > 0!");
            }

            _portInp.PrepareProcessing(
                Math.Max(DefaultParameters.MinimumQueueFrameCount, DefaultParameters.DefaultQueueMilliseconds.ToFrames(_portInp.Samplerate, _portInp.FrameSize)),
                Math.Max(DefaultParameters.MinimumBufferFrameCount, DefaultParameters.DefaultBufferMilliseconds.ToFrames(_portInp.Samplerate, _portInp.FrameSize))
                );

            _portOut.PrepareProcessing(
                DefaultParameters.DefaultQueueMilliseconds.ToSamples(_portOut.Samplerate),
                DefaultParameters.DefaultBufferMilliseconds.ToSamples(_portOut.Samplerate)
                );

            _outputIndex  = 0;
            _outputBuffer = new double[Math.Max(1, _portOut.Samplerate / 10)];
        }