Function: extractAudio()
ts
function extractAudio(url, options?): Promise<ExtractAudioResult>;Extract the audio track of a video into a separate audio file.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Local path of the video. |
options | Partial<ExtractAudioOptions> | Output format. Defaults to m4a (AAC). |
Returns
Promise<ExtractAudioResult>
The path and duration of the audio file, written to the cache directory.
Example
ts
const { outputPath, duration } = await extractAudio(videoUri);