Reverse() public method

Reverses the entire audio data.
public Reverse ( ) : void
return void
Beispiel #1
0
        public int GetData(GATData target, int targetLength, int offsetInTarget, bool reverse = false)
        {
            int nextIndex = ( int )_nextIndex;
            int sign      = reverse ? -1 : 1;
            int lastIndex = nextIndex + targetLength * sign;

            if (lastIndex >= _data.Count)
            {
                targetLength = _data.Count - nextIndex;
            }
            else if (lastIndex < 0)
            {
                targetLength = nextIndex + 1;
                lastIndex    = 0;
            }

            if (reverse == false)
            {
                target.CopyFrom(_data.ParentArray, offsetInTarget, nextIndex + _data.MemOffset, targetLength);
            }
            else
            {
                target.CopyFrom(_data.ParentArray, offsetInTarget, lastIndex + _data.MemOffset, targetLength);
                target.Reverse(offsetInTarget, targetLength);
            }

            _nextIndex = ( int )lastIndex;

            return(targetLength);
        }
Beispiel #2
0
        /// <summary>
        /// Immediately applies all
        /// processing properties to
        /// the passed GATData object.
        /// </summary>
        public virtual void ProcessSample(GATData sample)
        {
            if (_normalize)
            {
                sample.Normalize(_normalizeValue);
            }

            if (_reverse)
            {
                sample.Reverse();
            }

            if (_fadeInSamples > 0)
            {
                sample.FadeIn(_fadeInSamples);
            }

            if (_fadeOutSamples > 0)
            {
                sample.FadeOut(_fadeOutSamples);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Immediately applies all
        /// processing properties to
        /// the passed GATData object.
        /// </summary>
        public virtual void ProcessSample( GATData sample )
        {
            if( _normalize )
                sample.Normalize( _normalizeValue );

            if( _reverse )
                sample.Reverse();

            if( _fadeInSamples > 0 )
                sample.FadeIn( _fadeInSamples );

            if( _fadeOutSamples > 0 )
                sample.FadeOut( _fadeOutSamples );
        }