Git Product home page Git Product logo

Comments (5)

guest271314 avatar guest271314 commented on August 24, 2024

Found the issue with playback of the file twice.

Still not sure why it takes ~30 seconds for "Render Capacity" to, for lack of an appropriate technical term, "equalize" between the apparent two Worklet instances?

Note the Render Capacity @ ~7 seconds of playback ~83% and at ~19 seconds of playback 0%. Those values toggle between "high" and "low" for the first ~30 seconds of playback. Why? Is that by specification design?

Or, is AudioWorklet being affected by the parallel instance of ReadableStream reading the file being supplied as Float32Array to AudioWorklet (even with Use realtime priority thread for Audio Worklet Run Audio Worklet operation on a realtime priority thread for better audio stream stability. – Mac, Windows, Linux, Chrome OS, Android flag enabled)?

Screenshot_2020-02-22_19-53-15
Screenshot_2020-02-22_19-53-03

from web-audio-api-v2.

guest271314 avatar guest271314 commented on August 24, 2024

One issue that found is executing ReadableStream in a Worker for preparing input data, and AudioWorklet at the same time - that is, reading the stream and outputting audio at the same time before reading of the entire stream completes, in this case ~35MB completes - the playback will be "choppy".

That "choppy" effect changes to some degree when ReadableStream is piped to a WritableStream and the entire read/write (in this instance the write is posting a transferable Float32Array to AudioWorklet constructor) process is awaited for completion.

It iss not a simple task to determine precisely when the constructor has completed when port is receiving messages during construction and when process() begins in that case?

However, the requirement is to stream a WAV file (for now) and commence playback immediately at the first Uint8Array read at readable/writable, not to await completion of read (parse)/write.

Is executing/running ReadableStream() that supplies AudioWorklet with Float32Arrays in parallel tested by Web Audio API in WPT?

The tests at https://googlechromelabs.github.io/web-audio-samples/audio-worklet/ do not appeaar to be testing points of the design-pattern that are potentially susceptible to breaking, or at least not outputting audio output without undue latency when a parallel processing operation is ongoing.

from web-audio-api-v2.

padenot avatar padenot commented on August 24, 2024

This is about a Chrome bug, please file it in Chromium's bug tracker (although I'm pretty sure this is known).

from web-audio-api-v2.

guest271314 avatar guest271314 commented on August 24, 2024

@padenot Not necessarily a Chromium bug.

A deficiency in the design of AudioWorklet where the Worklet instances are imbalanced in certain circumstances, for example, where fetch and ReadableStream are being used (high priority) as to resource allocation, one of the Worklet instances appears to not perform its fair share of the work. Looking forward to testing AudioWorklet at Nightly. Until then Chromium is all we have at the front-end.

In any event, was able to resolve the issue late yesterday. The only issue am having now is trying to find a host that will store a 35MB .wav file for other individuals to test the POC version of a WebCodecs connection design-pattern - requesting a WAV file with fetch(), and playing the contents before the entire file is read using ReadableStream and WritableStream without using decodeAudioData(), AudioBuffer or AudioBufferSourceNode. Uploaded the WAV file to *oogle drive and it iss public, though not served with Access-Control-Allow-Origin:* header.

Will post the code anyway at #61 today or tomorrow, with link to the WAV file for testing by individuals other than self at localhost (even though have tested the code hundreds if not thousands of times over the past week). Currently have no way to test at different devices so am relying on only serving the file using php as the evidence for the pattern working. Certainly requires independent verification for a viable design-pattern for a WebCodecs-like connection to Web Audio API.

from web-audio-api-v2.

guest271314 avatar guest271314 commented on August 24, 2024

@padenot https://bugs.chromium.org/p/chromium/issues/detail?id=1055728

from web-audio-api-v2.

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.