effect-motion
API ReferencereactFunctions

prepareAudio

function prepareAudio<ID, E, R>(track, load): Layer<AudioLoader<ID> | AudioMetadata<ID> | AudioBuffer, E | EffectMotionError, R>;

Function: prepareAudio()

function prepareAudio<ID, E, R>(track, load): Layer<AudioLoader<ID> | AudioMetadata<ID> | AudioBuffer, E | EffectMotionError, R>;

Defined in: packages/react/src/BrowserAudio.ts:60

Prepare a browser track before a duration-driven scene starts. The same decoded buffer is used by the Player, and the duration describes those exact bytes. Each Player mount builds this layer in its own scope.

Type Parameters

Type Parameter
ID extends string
E
R

Parameters

ParameterType
trackAudioResource<ID>
loadEffect<Uint8Array<ArrayBufferLike>, E, R>

Returns

Layer<AudioLoader<ID> | AudioMetadata<ID> | AudioBuffer, E | EffectMotionError, R>

On this page