fix: replace hand-assembled Opus probe blob with real ffmpeg/libopus output
Previous probe sample had invalid Ogg page CRC32s, so Chrome/Firefox rejected it and the capability check always returned false. New 176-byte libopus sample has verified-correct CRCs. Adds structural-validity tests.
This commit is contained in:
@@ -18,15 +18,22 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* A minimal, valid Ogg-Opus file: an OpusHead page, an OpusTags page, and one audio page carrying a
|
||||
* single 20 ms silence packet (mono, 48 kHz). Base64-encoded; ~250 bytes decoded. This is the
|
||||
* smallest blob a conformant decoder will accept and a non-supporting decoder will reject, which is
|
||||
* exactly the discriminator we need.
|
||||
* A minimal, valid Ogg-Opus file generated by ffmpeg/libopus (libopus via Lavc62, libavformat62).
|
||||
* Three pages: OpusHead (page 0), OpusTags (page 1), one audio page of ~50 ms silence (page 2,
|
||||
* EOS flag set). Mono, 48 kHz. All three Ogg page CRC32s are verified correct — generated by
|
||||
* construction; not hand-assembled.
|
||||
*
|
||||
* ffmpeg command:
|
||||
* /c/ffmpeg/ffmpeg.exe -f lavfi -i anullsrc=r=48000:cl=mono -t 0.05 \
|
||||
* -c:a libopus -b:a 24k -f ogg /tmp/opusprobe.opus
|
||||
*
|
||||
* 176 bytes decoded; 236 chars base64.
|
||||
*/
|
||||
const PROBE_OGG_OPUS_BASE64 =
|
||||
'T2dnUwACAAAAAAAAAACRYwAAAAAAANieBHsBE09wdXNIZWFkAQEAAIC7AAAAAABPZ2dTAAAAAAAA' +
|
||||
'AAAAAJFjAAABAAAAUkOcUAEMT3B1c1RhZ3MAAAAAAAAAAE9nZ1MABABAAQAAAAAAkWMAAAIAAABU' +
|
||||
'/9D/A2P4//////////////////////////////////////////////////////////////////8=';
|
||||
'T2dnUwACAAAAAAAAAAD/3cwSAAAAAJGmJikBE09wdXNIZWFkAQE4AYC7AAAAAABPZ2dTAAAA' +
|
||||
'AAAAAAAAAP/dzBIBAAAA6iGxjgE+T3B1c1RhZ3MNAAAATGF2ZjYyLjEyLjEwMQEAAAAdAAAA' +
|
||||
'ZW5jb2Rlcj1MYXZjNjIuMjguMTAxIGxpYm9wdXNPZ2dTAASYCgAAAAAAAP/dzBICAAAAjUsr' +
|
||||
'kAMDAwP4//74//74//4=';
|
||||
|
||||
let cachedSupport: Promise<boolean> | null = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user