Skip to main content

SoundSyncTracker

Class

Tracks music beats and provides events for beat occurrences and playback state changes.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Index

Extends

Properties

fullSoundSync

readonly fullSoundSync: SoundSync

The complete beat synchronization data for the current music track.


isPlaying

readonly isPlaying: boolean

Indicates whether music is currently playing.


onBeat

readonly onBeat: event1<SoundSyncBeat, void>

Event triggered when any beat occurs in the music.


onDownBeat

readonly onDownBeat: event1<SoundSyncBeat, void>

Event triggered when a down beat (first beat within a measure) occurs in the music.


onPlaybackReset

readonly onPlaybackReset: event0<void>

Event triggered when music playback is stopped or reset.


onPlaybackStarted

readonly onPlaybackStarted: event1<ExternalMusicInfo, void>

Event triggered when music playback begins, providing information about the track.


onSoundSyncAvailable

readonly onSoundSyncAvailable: event0<void>

Event triggered when beat synchronization data becomes available for the track.


onSoundSyncCleared

readonly onSoundSyncCleared: event0<void>

Event triggered when beat synchronization data is cleared, such as when changing tracks.


playbackPosition

readonly playbackPosition: number

Current playback position (in seconds) of the tracked music.

Methods

getTypeName()

static getTypeName(): TypeName<SoundSyncTracker>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<SoundSyncTracker>

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame