Add support for reading and writing RF64 WAVE files

This commit is contained in:
Vanilagy
2025-07-18 16:48:23 +02:00
parent 2277810853
commit 4b12468008
10 changed files with 124 additions and 22 deletions
+9
View File
@@ -546,6 +546,12 @@ export class Mp3OutputFormat extends OutputFormat {
* @public
*/
export type WavOutputFormatOptions = {
/**
* When enabled, an RF64 file be written, allowing for file sizes to exceed 4 GiB, which is otherwise not possible
* for regular WAVE files.
*/
large?: boolean;
/**
* Will be called once the file header is written. The header consists of the RIFF header, the format chunk, and the
* start of the data chunk (with a placeholder size of 0).
@@ -565,6 +571,9 @@ export class WavOutputFormat extends OutputFormat {
if (!options || typeof options !== 'object') {
throw new TypeError('options must be an object.');
}
if (options.large !== undefined && typeof options.large !== 'boolean') {
throw new TypeError('options.large, when provided, must be a boolean.');
}
if (options.onHeader !== undefined && typeof options.onHeader !== 'function') {
throw new TypeError('options.onHeader, when provided, must be a function.');
}