Example #1
0
 public override void PrepareProcessing()
 {
     _active             = TristateActive.Inactive;
     _timeBecomeInactive = TimeStamp.Zero;
     _portIn.PrepareProcessing();
     _portThresh.PrepareProcessing();
     _portOut.PrepareProcessing();
 }
Example #2
0
 public override void PrepareProcessing()
 {
     _active = TristateActive.Inactive;
     _portIn.PrepareProcessing();
     _portThreshHigh.PrepareProcessing();
     _portThreshLow.PrepareProcessing();
     _portOut.PrepareProcessing();
 }
Example #3
0
        public override void PrepareProcessing()
        {
            _portInp.PrepareProcessing();
            _portOut.PrepareProcessing();

            _outputBuffer = new TimeLocatedBuffer1D <double>(
                DefaultParameters.DefaultBufferMilliseconds.ToSamples(_portInp.Samplerate),
                _portInp.Samplerate
                );
        }
Example #4
0
        public override void PrepareProcessing()
        {
            _input.PrepareProcessing();
            _output.PrepareProcessing();

            _bufOutput = new TimeLocatedBuffer1D <double>(
                DefaultParameters.DefaultBufferMilliseconds.ToSamples(_output.Samplerate) * 2, // TODO: * 2 pretty much magic
                _output.Samplerate
                );

            _resample = new LibResampler(_input.Samplerate, _output.Samplerate, _input.BufferCapacity, _bufOutput.Capacity);
        }
Example #5
0
        public override void PrepareProcessing()
        {
            if (PortIn1.Samplerate != PortIn2.Samplerate)
            {
                throw new InvalidOperationException("Samplerates do not match");
            }

            PortIn1.PrepareProcessing();
            PortIn2.PrepareProcessing();
            PortOut.PrepareProcessing();

            OutputBuffer = new TimeLocatedBuffer1D <double>(PortOut.Buffer.Capacity, PortOut.Samplerate);
        }
Example #6
0
        public override void PrepareProcessing()
        {
            if (_portIn.Samplerate == 0)
            {
                throw new InvalidOperationException("Input samplerate must be > 0");
            }

            if (_samplesPerRms <= 0)
            {
                throw new InvalidOperationException("Window length too short. Less than 1 sample.");
            }

            if (_portOut.Samplerate == 0)
            {
                throw new InvalidOperationException("Output samplerate is to small. Must be > 0. Chose a shorter window length");
            }

            _portIn.PrepareProcessing();
            _portOut.PrepareProcessing();

            _bufOut = new TimeLocatedBuffer1D <double>(DefaultParameters.DefaultBufferMilliseconds.ToSamples(_portOut.Samplerate), _portOut.Samplerate);
        }
Example #7
0
        // ----------------------------------------------------------------------------------------------------
        // HELPERS

        private void InitBuffer()
        {
            _samplesToKeep = (int)(_portInp.Samplerate * _attrMillis.TypedGet() / 1000);
            _portInp.PrepareProcessing(2 * _samplesToKeep, 2 * _samplesToKeep);
            _portOut.PrepareProcessing(2 * _samplesToKeep, 2 * _samplesToKeep);
        }