Re: Can users determine if audio has glitched?

This problem is more subtle than it appears, and I believe no trivial
solution exists.  As I currently understand it there's no provision for
dealing with overloading Web Audio (by running too many simultaneous
codecs, for example).  Previous attempts at solving this problem in the
field involve:

1) Setting deadlines for each node.  If a node exceeds its processing time;
it's killed off for being naughty;
2) Applying an integer priority to each node and/or route to the audio
output from each node.  Nodes are rendered in priority order.  This method
works reasonably well some of the time; however it makes bad choices for
certain kinds of sound combinations.
3) Perform a frequency analysis of the output of each node, determine
whether the sound is audible or masked, and drop sounds based on their
audibility on the output.  Very computationally expensive.

All of these solutions would, to my limited understanding, require either
architectural changes and/or a significant additional layer on top of Web
Audio.  At the very least, Web Audio would need to provide time reporting
mechanisms for processing time at the Node class level, which I don't
currently see in the source code.

I am happy to be corrected if my understanding is wrong.

jwb


On Mon, Jun 10, 2013 at 3:14 PM, Russell McClellan <russell@motu.com> wrote:

> Is there a way under the current API for users to determine if audio has
> glitched (in particular, because their ScriptProcessorNode was too slow)?
>
> This would be very useful, because then programs could increase buffer
> size or decrease audio quality based on whether or not the script processor
> was completing on time.
>
> The only way I can think to do this currently would be to inspect the
> playbackTime attribute on the AudioProcessingEvent and make sure that's
> it's increasing by exactly one buffer each call.  This seems a bit fragile
> to me, as perhaps there's other reasons why the web audio graph might
> decide to skip a buffer of script processing.
>
> Thanks,
> -Russell
>



-- 
---

John Byrd
Gigantic Software
2102 Business Center Drive
Suite 210-D
Irvine, CA   92612-1001
http://www.giganticsoftware.com
T: (949) 892-3526 F: (206) 309-0850

Received on Monday, 10 June 2013 22:37:37 UTC