文档

Unity Engine

Unity Engine

AllocateGenerator<TRealtime, TControl>(in TRealtime, in TControl, AudioFormat?, in CreationParameters)

Allocate a GeneratorInstance with the specified realtime and control state.
阅读时间1 分钟最后更新于 1 个月前

Definition

AllocateGenerator<T, U>(T, T, AudioFormat?, CreationParameters)

public readonly GeneratorInstance AllocateGenerator<TRealtime, TControl>(in TRealtime realtimeState, in TControl controlState, AudioFormat? nestedFormat = null, in GeneratorInstance.CreationParameters creationParameters = default) where TRealtime : unmanaged, GeneratorInstance.IRealtime where TControl : unmanaged, GeneratorInstance.IControl<TRealtime>

Parameters

realtimeState

T
The initial state available from the control thread.

controlState

T
The initial state available from the control thread.

nestedFormat

If not null, the returned GeneratorInstance will be treated as nested and use this format.

creationParameters

Additional parameters and initialization state for the processor. This is generally received from IAudioGenerator.CreateInstance

Returns

Type

Description

GeneratorInstanceA GeneratorInstance you own and control, that must later be destroyed with ControlContext.Destroy.

Remarks

This can generally be used to render the output of a IAudioGenerator, potentially from within another GeneratorInstance.
Additional Resources: IAudioGenerator.CreateInstance