4 ms·
Browser support of some codecs is inconsistent, for example Safari's support for opus has been pretty bad/nonexistent (iirc this recently changed)
by duped 2y ago
Browser support of some codecs is inconsistent, for example Safari's support for opus has been pretty bad/nonexistent (iirc this recently changed)
- pier25 2y agoThis. Even FLAC support isn't great.
- cupofjoakim 2y agoI used to work at a place that developed a DAW in the browser, and yeah, we used a WASM Ogg Opus decoder to save on storage costs for our sound library. We earlier had to have mp3s for safari devices. With opus being opus we really wanted to provide it for the majority of devices as well as our server side streaming, and being able to provide opus support for safari ourselves was a godsend. Edit: Should note that our decoder was developed in house and I have nothing to do with the project OP linked to.
- duped 2y agobandlab?
- lifthrasiir 2y agoIs that true even for mp3 though? Apparently it actually has a universal browser support up to MSIE 9 (!), while Ogg Vorbis and FLAC are now supported by all modern browsers after MSIE [1]. Opus seems to be the earliest format with less support than that, while this library only dates back to 2020. [1] https://caniuse.com/?search=audio%20format https://caniuse.com/?search=audio%20format
- duped 2y agoSure, but what if you don't want to use mp3... codecs aren't created equal. For anything latency sensitive mp3 is a non starter. For anything under bandwidth constraints, flac isn't great. OPUS is a descendant of CELT (which never caught on, for reasons) which is an open/unhindered by patents low latency lossy codec suitable for VoIP and live streaming. It's relatively recent, but also, those use cases are more popular recently in the browser. And to go even more extreme, some applications really care about bit-exactness in their decoders, which you don't get by relying on other vendors.
- lifthrasiir 2y agoI mean, WebAssembly Opus decoder seems meaningful even to this day, but I wondered why earlier formats are there in the first place. The bit-exactness is a good argument but as you've said that's a very specific requirement, and the library only seems to care about performance and minified size anyway.
- ctoth 2y agoBeing able to decode audio in a Web Worker rather than the main UI thread is also a nice use case.
- AshleysBrain 2y agoWebM Opus is an open format that plays in all modern browsers now - including recent Safari releases. There are still some bugs though last I checked.