mon / 0x40-web

Pretty images and colours
http://0x40.mon.im/
MIT License
388 stars 38 forks source link

Add support for the Opus codec? #67

Closed 505e06b2 closed 2 years ago

505e06b2 commented 2 years ago

Just wondering if this has been considered, as Opus is the successor to Vorbis, and hardware decoding does not seem to be a concern for this project. The biggest caveat I can see is that their extensions could be the same (ogg) so would require reading the metadata to determine the correct decoder

Regardless, thanks for all your hard work! I've been using this on and off since at least early 2016 and it has only improved in that time

mon commented 2 years ago

It's really no problem, aurora.js (the fallback decoder for Safari because Apple hates open codecs) has an opus module that I can include, and it should demux that without any issues.

I'll take a look in the coming weeks to see how easy the integration is.

mon commented 2 years ago

There is a tentative addition of opus on my own 0x40 - try and load an opus encoded file and see if it works. I really should just get my own opus ogg and test it, but somewhat time poor.

505e06b2 commented 2 years ago

Works for me, though I don't currently have any Apple devices to hand to properly test this codepath (there doesn't seem to be any regressions at least). I made this quick respack, which should hopefully be of some use - the song is Machineheart + Vanic - Circles: opus_respack.zip

mon commented 2 years ago

Thanks, nice respack!

I locally forced the fallback codepath and the loop loads fine, no gaps. Decoding is little slower, but that's to be expected. Crazy how small opus encoded audio is... Fixed in af88533573167cfe32d4157a9923c0f56093038c