Implement ADTS muxer :3

This commit is contained in:
Ally
2025-08-17 16:14:15 +02:00
parent 0cb466ebb1
commit 1ce5e108a7
8 changed files with 262 additions and 31 deletions
+9 -1
View File
@@ -561,7 +561,15 @@ export const extractAudioCodecString = (trackInfo: {
throw new TypeError(`Unhandled codec '${codec}'.`);
};
export const parseAacAudioSpecificConfig = (bytes: Uint8Array | null) => {
export type AacAudioSpecificConfig = {
objectType: number;
frequencyIndex: number;
sampleRate: number | null;
channelConfiguration: number;
numberOfChannels: number | null;
};
export const parseAacAudioSpecificConfig = (bytes: Uint8Array | null): AacAudioSpecificConfig => {
if (!bytes || bytes.byteLength < 2) {
throw new TypeError('AAC description must be at least 2 bytes long.');
}