Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

SeekMessage

struct in UnityEngine.Audio

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

Description

A built-in message that moves the playback position of a generator.

Send a SeekMessage to a generator with ControlContext.SendMessage. A generator supports seeking only if it handles this message. An AudioClip used as a generator handles SeekMessage out of the box, including within nested generator hierarchies; a custom generator opts in through its control part's ProcessorInstance.IControl<T0>.OnMessage method.



SeekMessage.destination is the position to jump to and SeekMessage.when is the position at which the seek takes effect. A null SeekMessage.when seeks immediately. Send seeks in any order: an AudioClip generator applies them in send order, and drops a seek whose SeekMessage.when position playback has already passed when that seek becomes the next one due. A custom generator defines its own seek handling in ProcessorInstance.IControl<T0>.OnMessage; follow the same rules where they apply so seeks behave consistently across generator types.

Additional resources: ControlContext.SendMessage, AudioClip

Properties

Property Description
destinationContent position to jump to.
whenContent position at which the seek takes effect. Null applies the seek immediately.

Constructors

Constructor Description
SeekMessageCreates a seek request.