Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

AudioClip.CreateInstance(ControlContext,AudioFormat?,CreationParameters)

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Parameters

Parameter Description
context The context in which the instance will be created.
nestedFormat If not null, the instance will be created with the the given format as nested, to be used from within another processor.
creationParameters Initialization parameters passed through.

Returns

void Returns the generator instance of the clip.

Description

Factory method for creating a GeneratorInstance of this clip.

Use this method to efficiently stream the AudioClip data as a GeneratorInstance. You can use the instance directly with a RealtimeContext or nest it within other GeneratorInstances to facilitate advanced playback behaviours. Note that you can only use persistent (imported) audio clips as generators. Runtime-created clips (via AudioClip.Create, DownloadHandlerAudioClip, or Microphone) throw a NotSupportedException.

Once an AudioClip has been used as a generator, AudioClip.GetData and AudioClip.SetData are permanently blocked for that clip instance.

Additional resources: Using AudioClips as generators.