Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { createWasmCodec } from "./wasm-base.js";
function aacMagic(bytes: Uint8Array): boolean {
if (bytes.byteLength < 2) return false;
// ADTS sync word: 0xFFFx
return bytes[0] === 0xff && (bytes[1]! & 0xf0) === 0xf0;
}
/** Lazy AAC codec backed by `@audio/decode-aac`. Decode-only. */
export const AacCodec = createWasmCodec({
name: "aac",
extensions: ["aac", "m4a"],
mimeTypes: ["audio/aac", "audio/mp4"],
module: "@audio/decode-aac",
magic: aacMagic,
supportsEncode: false,
load: () =>
// @ts-expect-error optional dependency resolved at runtime
import("@audio/decode-aac"),
});