Giter Site home page Giter Site logo

Synchronous encoding/decoding about webcodecs HOT 5 CLOSED

w3c avatar w3c commented on June 26, 2024
Synchronous encoding/decoding

from webcodecs.

Comments (5)

steveanton avatar steveanton commented on June 26, 2024 1

Would it be possible to keep the same API but have a flag which instructs the user agent to run the codec synchronously?

I'm not sure all the requirements for the synchronous API (e.g., whether it's ok to unwind the stack or not), but this approach would at least ensure the encoding/decoding happens in the same task.

from webcodecs.

chcunningham avatar chcunningham commented on June 26, 2024 1

@anthumchris - I wouldn't expect folks to do much decoding in the AudioWorklet process() loop. Audio rendering needs to meet tight deadlines and be glitch free. The ideal setup would be to do decoding in a worker (async is fine) and send the decoded output to AudioWorklet using a SharedArrayBuffer. See this overview.

from webcodecs.

padenot avatar padenot commented on June 26, 2024 1

Being able to synchronously decode is essential for folding a bit of the packetization latency inside the audio output latency, for a decode-type scenario and lowering the overall end-to-end latency.

from webcodecs.

chcunningham avatar chcunningham commented on June 26, 2024 1

This also came up in #51. That issue was closed with rationale:

We discussed this in the call w/ audio epxerts. It is true that many are coming from a synchronous API, but they concluded that this was not a requirement for them. We also discussed how our API's under the hood are often async and they stated that they did not desire for us to hide that from them at the JS layer. Please open a new issue for this if I've overlooked anything.

Closing this issue with same reasoning.

from webcodecs.

anthumchris avatar anthumchris commented on June 26, 2024

I think synch audio decoding could be especially important for an AudioWorklet, which would need to use synchronous functions within its process() loop.

from webcodecs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.