Options for exporting audio
Properties#
| Property | Type | Description |
|---|---|---|
mimeType? |
AudioMimeType |
The audio format to encode. Defaults to 'audio/wav'. Both bindings have always accepted this — @cesdk/engine asserts it in its options schema and the native addon reads it — but the declaration omitted it, so the documented call exportAudio(block, { mimeType: 'audio/wav' }) did not typecheck. |
timeOffset? |
number |
Time offset in seconds relative to the target block |
duration? |
number |
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 |
Sample rate in Hz |
numberOfChannels? |
number |
Number of channels |
skipEncoding? |
boolean |
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 |
The codec of an 'audio/mp4' or 'audio/webm' export. Defaults to AudioCodec.Auto. For 'audio/mp4' it picks AAC, and Opus where the platform encodes Opus but not AAC. For 'audio/webm' it picks Opus, then Vorbis. A codec that the file type cannot hold fails the export, and so does an explicit codec that the platform cannot encode. |
onProgress? |
(rendered, encoded, total) => void |
Progress callback |
abortSignal? |
AbortSignal |
Cancels the export when it aborts, and the promise rejects at once. An export that mixes the page stops at once. An export that copies the audio of one block without the mixer finishes the copy in the background and drops it. |