AllocateGenerator<TRealtime, TControl>(in TRealtime, in TControl, AudioFormat?, in CreationParameters)
Allocate a GeneratorInstance with the specified realtime and control state.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Audio
- Assembly: UnityEngine.AudioModule
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
If not null, the returned GeneratorInstance will be treated as nested and use this format.
Additional parameters and initialization state for the processor. This is generally received from IAudioGenerator.CreateInstance
Returns
Type | Description |
|---|---|
| GeneratorInstance | A 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