W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2013

Re: [web-audio-api] (SamplingFormat): Define sampling format (#110)

From: Olivier Thereaux <notifications@github.com>
Date: Wed, 11 Sep 2013 07:29:39 -0700
To: WebAudio/web-audio-api <web-audio-api@noreply.github.com>
Message-ID: <WebAudio/web-audio-api/issues/110/24244265@github.com>
> [Original comment](https://www.w3.org/Bugs/Public/show_bug.cgi?id=17394#1) by Olivier Thereaux on W3C Bugzilla. Thu, 07 Jun 2012 14:24:48 GMT

Changeset from the editor: https://dvcs.w3.org/hg/audio/rev/b4680b4ee21d

Comment from Philip in http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0434.html
The definition of float should be left to WebIDL:  

What we wanted to know is how to interpret NaN and Infinity when passing  
the data on to the actual hardware. The best way to spec this might be as  
a clamping step in AudioDestinationNode, to say that NaN is interpreted as  
0 and all other values are clamped to the [-1, 1] range. In other words,  
Infinity becomes 1 and -Infinity -1, such that it is well defined how a  
JavaScript generating a square wave oscillating between infinities will  

We think that there will be inconsistencies between implementations in how  
NaN values in the input of the various nodes affect the output, since it  
depends a lot on the implementation technique. We're not going to suggest  
defining that exactly at this point, but we may have reason to re-visit it  
when implementing.

Comment from Ray in http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0436.html
It seems that once a NaN or infinity has been generated, something
seriously wrong is going on and should be fixed there.  Having to check for
NaN or infinity on the input of every node seems like a lot of overhead for
a situation that should not occur at all.  This excludes your example of a
JavaScript node generating infinities on purpose.  I don't understand why
you would want to do that in practice.

Comment from Philip in http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0443.html
Of course script should not intentionally generate NaN or infinities, but  
like with all Web-facing APIs we can be 100% certain that people will  
accidentally do it. WebKit must already do *something* in this situation,  
so we can just spec that if it makes sense. With offline audio contexts,  
the result will be script-visible and a complete test suite must cover  
this case.

Reply to this email directly or view it on GitHub:
Received on Wednesday, 11 September 2013 14:30:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:03:24 UTC