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: October 8, 2026 at 10:45 AMEdit this page