web-audio-api-rs icon indicating copy to clipboard operation
web-audio-api-rs copied to clipboard

Fail to decode opus codec

Open subframe7536 opened this issue 1 year ago • 3 comments

Thanks for your great work!

I'm just using the example decode_multithreaded with sample files to test decoding, but it fails:

./samples/flac.flac - Success - decoded 442368 samples
./samples/ogg.opus - Error - Unsupported("core (codec):unsupported codec")
./samples/mp3.mp3 - Success - decoded 441216 samples
./samples/wav.wav - Success - decoded 441344 samples

subframe7536 avatar Sep 14 '24 03:09 subframe7536

Hello and thanks for flagging. We use the symphonia library for decoding and it appears they do not have support for opus yet https://github.com/pdeljanov/Symphonia/issues/8 Adding opus capabilities directly into this lib is something I would rather not do as it is not core to the audio api feature set. Perhaps you can convert the files beforehand?

orottier avatar Sep 14 '24 10:09 orottier

Thanks for your explaination!

Im trying to migrate the audio control from frontend to backend, and just encounter this upstream issue. Maybe your advice is the best way currently.

subframe7536 avatar Sep 14 '24 11:09 subframe7536

Thanks for understanding. I'm leaving this issue open for visibility and future reconsideration. Regarding encoding, in #508 we plan to add support for more types so perhaps that might result in changes to decoding support

orottier avatar Sep 15 '24 05:09 orottier