AudioAsset.getDuration

Gets the duration of the audio in seconds

AudioAsset.getDuration() method

Gets the duration of the audio in seconds

Signature:

getDuration(): Promise<number | null>;

Returns:

Promise<number | null>

A promise that resolves to the duration, or null if it cannot be determined

Example

const seconds = await audioAsset.getDuration();
Last updated: November 10, 2026 at 8:00 PMEdit this page