type AudioExportOptions = object;Represents the options for exporting audio.
Defines the possible options for exporting audio.
- ‘mimeType’: The MIME type of the output audio file.
- ‘onProgress’: A callback which reports on the progress of the export.
- ‘timeOffset’: The time offset in seconds relative to the target block.
- ‘duration’: The duration in seconds of the final audio.
- ‘sampleRate’: The sample rate of the exported audio.
- ‘numberOfChannels’: The number of channels of the exported audio.
- ‘skipEncoding’: Copy the raw 48 kHz stereo float samples of a buffer into a WAV file without encoding them. The copy starts at the first sample, and the block duration limits its length. It ignores the time offset, the duration and the trim. Any other export runs as it does without this option.
Properties#
| Property | Type | Default value | Description |
|---|---|---|---|
mimeType? |
AudioMimeType |
'audio/wav' |
The MIME type of the output audio file. |
onProgress? |
(numberOfRenderedFrames, numberOfEncodedFrames, totalNumberOfFrames) => void |
undefined |
A callback which reports on the progress of the export. |
timeOffset? |
number |
0 |
The time offset in seconds relative to the target block. |
duration? |
number |
The duration of the block. |
The duration in seconds of the final audio. A WAV file holds at most 11,184.81 seconds of audio, so a longer WAV export fails. |
sampleRate? |
number |
48000 |
The sample rate of the exported audio. |
numberOfChannels? |
number |
2 |
The number of channels of the exported audio. |
skipEncoding? |
boolean |
false |
Copy the raw 48 kHz stereo float samples of a buffer into a WAV file without encoding them. The copy starts at the first sample, and the block duration limits its length. It ignores the time offset, the duration and the trim. Any other export runs as it does without this option. |
audioCodec? |
AudioCodec |
AudioCodec.Auto |
The codec of an 'audio/mp4' export. AudioCodec.Auto picks AAC, and Opus in a browser that encodes Opus but not AAC, such as Firefox or Chrome on Linux. An explicit codec that the browser cannot encode fails the export: check editor.getCapabilityState('aacEncode') or 'opusEncode' first. A WAV export ignores it. |
abortSignal? |
AbortSignal |
undefined |
An AbortSignal that can be used to cancel the audio export operation. |