Create @mediabunny/mp3-encoder, restructure and extend build system

This commit is contained in:
Vanilagy
2025-08-10 00:45:30 +02:00
parent 7a2a23bcb0
commit cbb2681d33
38 changed files with 2913 additions and 112 deletions
+42
View File
@@ -0,0 +1,42 @@
/*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
export type WorkerCommand = {
type: 'init';
data: {
numberOfChannels: number;
sampleRate: number;
bitrate: number;
};
} | {
type: 'encode';
data: {
audioData: ArrayBuffer;
numberOfFrames: number;
};
} | {
type: 'flush';
};
export type WorkerResponseData = {
success: boolean;
} | {
encodedData: ArrayBuffer;
} | {
flushedData: ArrayBuffer;
};
export type WorkerResponse = {
id: number;
} & ({
success: true;
data: WorkerResponseData;
} | {
success: false;
error: unknown;
});