Re: [web-audio-api] (JSWorkers): ScriptProcessorNode processing in workers (#113)

> [Original comment](https://www.w3.org/Bugs/Public/show_bug.cgi?id=17415#69) by Grant Galitz on W3C Bugzilla. Fri, 27 Jul 2012 16:38:56 GMT

(In reply to [comment #60](#issuecomment-24244654))
> > - We need a reliable main-context event system for scheduling audio actions
> > (setInterval is not up to it, it seems).
> 
> There can't be any truly reliable way to schedule audio actions on the main
> thread.
> 
> I doubt you can do better than setInterval plus some way to measure audio
> progress, such as mozCurrentSampleOffset.

Funny story, mozCurrentSampleOffset is essentially non-functional on Linux Firefox. Timing audio off of it has been broken since it was introduced.

The callback for more samples method is best because it tells me exactly how many samples it needs. With mozCurrentSampleOffset and mozWriteAudio we were actually exposed to each OS's buffering edge cases, and still are! I have the user agent sniff for windows Firefox for instance to insert a shadow 100 ms of extra buffering otherwise windows Firefox stops the audio clock. This is in contrast to Mac Firefox being perfect at all buffer levels.

Why even a faulty mozCurrentSampleOffset is better than no buffering determination: Being forced to use time stamps to generate audio from the lack of audio clock access though would be much much worse, as things like sleep events and time zone changes will kill the timed logic.

---
Reply to this email directly or view it on GitHub:
https://github.com/WebAudio/web-audio-api/issues/113#issuecomment-24244718

Received on Wednesday, 11 September 2013 14:38:12 UTC