GAudio.GATMaths.ResampledLength C# (CSharp) Méthode

ResampledLength() public static méthode

public static ResampledLength ( int sourceLength, double resamplingFactor ) : int
sourceLength int
resamplingFactor double
Résultat int
        public static int ResampledLength( int sourceLength, double resamplingFactor )
        {
            return ( int )( sourceLength / resamplingFactor );
        }

Usage Example

            void SetPitch(double newPitch)
            {
                if (newPitch == _nextPitch)
                {
                    return;
                }

                _nextPitch       = newPitch;
                _needsDataUpdate = true;


                if (envelope == GATEnvelope.nullEnvelope)
                {
                    _cachedLength      = GATMaths.ResampledLength(sourceSample.Count, _nextPitch);
                    _needsNewContainer = true;
                }
            }