Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing opus support #8

Open
badaix opened this issue Sep 26, 2020 · 7 comments
Open

Missing opus support #8

badaix opened this issue Sep 26, 2020 · 7 comments
Labels
feature request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@badaix
Copy link
Owner

badaix commented Sep 26, 2020

Snapweb should support opus. There is a opus branch with a emscripten cross compiled opus library, but it's getting out of sync during playback, maybe the decoding must be done in a thread.

@tilllt
Copy link

tilllt commented Apr 5, 2021

Naive question, but can't snapweb use the built-in browsers codecs (like OPUS) and achieve sync by using browser internal mechanisms like this?

https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/playbackRate

@kingosticks
Copy link

kingosticks commented Apr 11, 2021

No. We need to be able to decode raw Opus, browsers handle Ogg Opus. I don't think playbackrate helps us with this but maybe I'm misunderstanding you. Something like https://github.com/samirkumardas/opus-to-pcm goes some way to explain the issue (I'm not an expert on Ogg but I'm not convinced about the framing implementation and the flushing config setting). More interesting is the upcoming https://w3c.github.io/webcodecs/ API which would be perfect. Looks like it's in Chrome 86 (behind a feature flag) and Firefox are working on supporting it. I guess it won't be available for a long while yet. Best off finding a libopus wasm library in the meantime, we probably don't care about a huge file size.

@tilllt
Copy link

tilllt commented Apr 11, 2021

I understand that snapcast needs the raw opus stream, not the ogg encapsuled opus, so that's a problem if the built-in codec cannot decode raw opus.

In any case, it seems that other programs successfully integrated emscripten versions of opus, specifically the aurora.js project...

https://github.com/audiocogs/opus.js

@kingosticks
Copy link

Yes, someone just needs to do it.

@m040601
Copy link

m040601 commented Dec 13, 2022

Can anyone give an update on this situation for non technical users ? Was there any progress regarding this issue ?

After some years of using snapcast already, I ended up here today because I was testing the builtin Snapweb client on Firefox (http://myserver:1780/).

I rarely use a web browser as a client, so I hadnt noticed this before.

After many years of using Firefox I was quite surprised to find this messages:

Codec not supported: ogg

and

Codec not supported: opus

I am 99.99 % sure that I have already listened to other radio streams in ogg or opus in Firefox, so this "not supported" message has nothing to do with Firefox itself. Am I correct ?

It's some "opus support" or "ogg support" missing from Snapcast . Am I correct ?

@blacklight
Copy link

blacklight commented Feb 16, 2024

Any progress on this issue? From what I understand the possible solutions would include:

  1. Piggyback on opus.js
  2. Make a custom WASM wrapper
  3. Wait for the webcodecs API to be released

Is my understanding correct that the opus.js way may be the favourite one?

Btw if the problem is only with raw opus and not with ogg opus then why do I get Codec not supported: ogg as well?

@blacklight
Copy link

It's some "opus support" or "ogg support" missing from Snapcast . Am I correct ?

It's not on Snapcast, technically speaking. If you configure codec=opus on Snapserver and then you play from the Snapclient service or from the Android app, everything goes well.

That's because those applications use the native Opus decoders.

The problem is only with the Web side, as raw Opus (apparently) isn't natively supported, thus support can be added either through an external library, or by sideloading the codec through a WASM wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants