Add FLAC support to ISOBMFF demuxer

This commit is contained in:
Vanilagy
2025-01-02 00:03:32 +01:00
parent 4e0b3a7b3a
commit 8a8fbc264e
3 changed files with 81 additions and 35 deletions
+6 -2
View File
@@ -35,6 +35,8 @@ export const AUDIO_CODECS = [
'aac',
'mp3',
'opus',
'vorbis',
'flac',
'ulaw',
'alaw',
...PCM_CODECS,
@@ -398,14 +400,16 @@ export const extractAudioCodecString = (codec: AudioCodec, description: Uint8Arr
return 'mp3';
} else if (codec === 'opus') {
return 'opus';
} else if (codec === 'vorbis') {
return 'vorbis';
} else if (codec === 'flac') {
return 'flac';
} else if (codec.startsWith('pcm-')) {
return codec;
} else if (codec === 'ulaw') {
return 'ulaw';
} else if (codec === 'alaw') {
return 'alaw';
} else if (codec === 'vorbis') {
return 'vorbis';
}
throw new TypeError(`Unhandled codec '${codec}'.`);