Assets/Plugins/Unity.DSPGraph/Runtime/DSPCommandBlock.cs
/// <summary>
/// Inserts a sample provider to the list
/// </summary>
/// <param name="clip">The provider to be inserted on the specified <typeparamref name="DSPNode"/></param>
/// <param name="node">The node to set the audio sample provider on</param>
/// <param name="item">The sample provider 'slot' that the given provider should be inserted into</param>
/// <param name="index">The index into the array that the provider should be set. This is if the sample provider slot is an array.</param>
/// <param name="startSampleFrameIndex">The first frame of the audio clip to be used in the sample provider</param>
/// <param name="endSampleFrameIndex">The last frame of the audio clip to be used in the sample provider</param>
/// <param name="loop">Whether the clip should be looped</param>
/// <param name="enableSilencePadding">Whether the provider should emit silence after clip playback ends</param>
/// <typeparam name="TParameters">Enum type of the parameters of the node</typeparam>
/// <typeparam name="TProviders">Enum type of the sample providers of the node</typeparam>
/// <typeparam name="TAudioKernel">The kernel type of the node</typeparam>
/// <exception cref="ArgumentNullException">If the passed <typeparamref name="AudioClip"/>is null</exception>
/// <exception cref="InvalidOperationException">If the passed index into the sample provider slot is invalid</exception>
Inserts a sample provider to the list
Inserts a sample provider to the list
public void InsertSampleProvider<TParameters, TProviders, TAudioKernel>(
            AudioClip clip, DSPNode node, TProviders item, int index = -1,
            long startSampleFrameIndex = 0, long endSampleFrameIndex = 0, bool loop = false, bool enableSilencePadding = false)
            where TParameters   : unmanaged, Enum
            where TProviders    : unmanaged, Enum
            where TAudioKernel : struct, IAudioKernel<TParameters, TProviders>
        {
            if (clip == null)
                throw new ArgumentNullException(nameof(clip));
            InsertSampleProvider<TParameters, TProviders, TAudioKernel>(clip.Internal_CreateAudioClipSampleProvider((ulong)startSampleFrameIndex, endSampleFrameIndex, loop, enableSilencePadding),
                node, item, index, true);
        }
public void InsertSampleProvider < TParameters , TProviders , TAudioKernel > ( AudioClip clip , DSPNode node , TProviders item , int index = - 1 , long startSampleFrameIndex = 0 , long endSampleFrameIndex = 0 , bool loop = false , bool enableSilencePadding = false ) where TParameters : unmanaged , Enum where TProviders : unmanaged , Enum where TAudioKernel : struct , IAudioKernel < TParameters , TProviders > { if ( clip == null ) throw new ArgumentNullException ( nameof ( clip ) ) ; InsertSampleProvider < TParameters , TProviders , TAudioKernel > ( clip . Internal_CreateAudioClipSampleProvider ( ( ulong ) startSampleFrameIndex , endSampleFrameIndex , loop , enableSilencePadding ) , node , item , index , true ) ; }
Inserts a sample provider to the list
Inserts a sample provider to the list
If the passed is null
If the passed is null
If the passed index into the sample provider slot is invalid
If the passed index into the sample provider slot is invalid
clip
AudioClip
The provider to be inserted on the specified
The provider to be inserted on the specified
node
DSPNode
The node to set the audio sample provider on
The node to set the audio sample provider on
item
TProviders
The sample provider 'slot' that the given provider should be inserted into
The sample provider ' slot ' that the given provider should be inserted into
index
int
The index into the array that the provider should be set. This is if the sample provider slot is an array.
The index into the array that the provider should be set . This is if the sample provider slot is an array .
startSampleFrameIndex
long
The first frame of the audio clip to be used in the sample provider
The first frame of the audio clip to be used in the sample provider
endSampleFrameIndex
long
The last frame of the audio clip to be used in the sample provider
The last frame of the audio clip to be used in the sample provider
loop
bool
Whether the clip should be looped
Whether the clip should be looped
enableSilencePadding
bool
Whether the provider should emit silence after clip playback ends
Whether the provider should emit silence after clip playback ends
typeparam
Enum type of the parameters of the node
Enum type of the parameters of the node
typeparam
Enum type of the sample providers of the node
Enum type of the sample providers of the node
typeparam
The kernel type of the node
The kernel type of the node