ennuicastr / libavjs-webcodecs-polyfill

A polyfill for the WebCodecs API. No, really.
82 stars 8 forks source link

Audio Encoding Samples doesn't run on Safari #20

Closed kareljuricka closed 1 year ago

kareljuricka commented 1 year ago

Hi,

when I try to run project samples in Safari browser (16.5) on my MacOs 13.4, after encoding FLAC (https://github.com/ennuicastr/libavjs-webcodecs-polyfill/blob/master/samples/audio-encoder-flac/) I got error in HTML Audio Player. Same thing happening with opus codec. I understand that opus is not supported, but flac should be. Do I miss something? It works OK in Chrome and Firefox.

Thanks for your answer

Yahweasel commented 1 year ago

Neither FLAC nor Opus work on Safari, not because Safari doesn't support the codecs, but because Safari doesn't support sane container formats. Both work on Safari if you put them in a nonsensical container format that won't work anywhere else. The sample works fine on Safari, and makes a FLAC file just fine on Safari, but Safari does not support FLAC in FLAC's container, at least not in <audio> objects. Encoding to FLAC (and Opus) work.