GAudio.GATSampleBank.FillWithResampledData C# (CSharp) Method

FillWithResampledData() protected method

protected FillWithResampledData ( GATData sourceData, GATData targetData, int fromIndex, int targetLength, double pitch ) : void
sourceData GATData
targetData GATData
fromIndex int
targetLength int
pitch double
return void
        protected void FillWithResampledData( GATData sourceData, GATData targetData, int fromIndex, int targetLength, double pitch )
        {
            //check that we have enough samples to fulfill the request:
            int appliedLength = GATMaths.ClampedResampledLength( sourceData.Count - fromIndex, targetLength, pitch );

            if( appliedLength < 0 )
            {
                #if GAT_DEBUG
                Debug.LogWarning( "requested offset is out of bounds." );
                #endif
                return;
            }

            sourceData.ResampleCopyTo( fromIndex, targetData, appliedLength, pitch );

            //if we did not have enough samples, clear the rest:
            if( appliedLength < targetLength )
            {
                targetData.Clear( appliedLength, targetData.Count - appliedLength );
            }
        }

Same methods

GATSampleBank::FillWithResampledData ( GATData data, int indexInBank, int fromIndex, int targetLength, double pitch ) : void
GATSampleBank::FillWithResampledData ( GATData data, string sampleName, int fromIndex, int targetLength, double pitch ) : void