<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17399</bug_id>
          
          <creation_ts>2012-06-05 12:19:24 +0000</creation_ts>
          <short_desc>(AudioParamSampling): AudioParam sampling is undefined</short_desc>
          <delta_ts>2014-10-28 17:16:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>AudioWG</product>
          <component>Web Audio API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>TBD</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael[tm] Smith">mike</reporter>
          <assigned_to name="Chris Rogers">crogers</assigned_to>
          <cc>olivier.thereaux</cc>
    
    <cc>ot</cc>
    
    <cc>philipj</cc>
    
    <cc>public-audio</cc>
    
    <cc>roc</cc>
          
          <qa_contact name="This bug has no owner yet - up for the taking">dave.null</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68711</commentid>
    <comment_count>0</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2012-06-05 12:19:24 +0000</bug_when>
    <thetext>Audio-ISSUE-42 (AudioParamSampling): AudioParam sampling is undefined [Web Audio API]

http://www.w3.org/2011/audio/track/issues/42

Raised by: Philip Jägenstedt
On product: Web Audio API

It is not defined how the AudioParam values (ramps or AudioNode input) are sampled. These approaches would yield hugely different results:

 * Sample-and-hold at the beginning of each processing buffer (if they exist in the implementation).
 * Correct downsampling with low pass filtering to below the Nyquist frequency for each processing buffer. This could turn a 20KHz signal into silence.
 * Continuously per audio sample at the mixing level. Slow?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68785</commentid>
    <comment_count>1</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-06-07 08:17:23 +0000</bug_when>
    <thetext>[admin] Assigning items currently being worked on by editor.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68810</commentid>
    <comment_count>2</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-06-07 14:53:02 +0000</bug_when>
    <thetext>Changeset from the editor: 
https://dvcs.w3.org/hg/audio/rev/3837e5414cad</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68811</commentid>
    <comment_count>3</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-06-07 14:53:51 +0000</bug_when>
    <thetext>Feedback from Philip in http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0433.html

«This is certainly an improvement! More feedback:

The sampling of k-rate parameters is not defined, the sensible options  
would seem to be either the average value over one working buffer (128  
samples) or picking the first, middle or last sample for that work buffer.  
In other words, if a signal oscillating between 0 and 1 at 20 KHz  
oscillator is used to control delayTime, will it be effectively a constant  
0.5 second delay or a &quot;random&quot; delay for each work buffer depending on the  
phase of the signal?

Editorial issues:

&quot;Please note that the &lt;code&gt;frequency&lt;/code&gt;, &lt;code&gt;Q&lt;/code&gt;, and  
&lt;code&gt;gain&lt;/code&gt; parameters are &lt;em&gt;k-rate&lt;/em&gt;&quot; can be replaced with  
&quot;All parameters are &lt;em&gt;k-rate&lt;/em&gt;&quot;.

Lowercase and uppercase MUSTs are now both used, presumably not  
intentionally.

Typo: coursely -&gt; coarsely
»</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68879</commentid>
    <comment_count>4</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-06-08 20:03:06 +0000</bug_when>
    <thetext>More detail added in:
https://dvcs.w3.org/hg/audio/rev/3837e5414cad</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68912</commentid>
    <comment_count>5</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-06-11 11:44:06 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Changeset from the editor: 
&gt; https://dvcs.w3.org/hg/audio/rev/3837e5414cad

For the record: the &quot;older&quot; changeset was https://dvcs.w3.org/hg/audio/rev/0f614b03b8cb

https://dvcs.w3.org/hg/audio/rev/3837e5414cad is the new changeset, addressing the concerns and suggestions from comment #3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68951</commentid>
    <comment_count>6</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-06-12 08:34:16 +0000</bug_when>
    <thetext>What spec says is now mostly correct, but the wrong part is normative. What implementation *actually* have to do is sample at the beginning of a each 128-sample block, but this is not normative. Conversely, the 3ms requirement *is* normative, even though 3ms at 8KHz is 24 samples and not what will actually be implemented.

Suggestion: Remove all mention of 3ms and state:

&lt;p&gt;
Implementations must use block processing, with each &lt;code&gt;AudioNode&lt;/code&gt; processing 128 sample-frames in each block.
&lt;/p&gt;

and

&lt;p&gt;
For each 128 sample-frame block, the value of a &lt;em&gt;k-rate&lt;/em&gt; parameter must be sampled at the time of the very first sample-frame, and that value must be used for the entire block.
&lt;/p&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68953</commentid>
    <comment_count>7</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-06-12 08:52:54 +0000</bug_when>
    <thetext>To clarify, the section mentioning 3ms would be rewritten to end in something like &quot;a &lt;em&gt;k-rate&lt;/em&gt; parameter whose value changes must be taken at the beginning of each 128 sample-frame block.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69098</commentid>
    <comment_count>8</comment_count>
    <who name="Robert O&apos;Callahan (Mozilla)">roc</who>
    <bug_when>2012-06-15 15:38:45 +0000</bug_when>
    <thetext>Was it decided to specify sampling in terms of the number of samples instead of a time duration?

I prefer the use of a time duration (gives the implementation more flexibility to be sample-rate-independent), and I thought the discussion on the mailing list about the minimum delay for DelayNodes was heading that way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69100</commentid>
    <comment_count>9</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-06-15 15:52:03 +0000</bug_when>
    <thetext>If defined in seconds, (In reply to comment #8)
&gt; Was it decided to specify sampling in terms of the number of samples instead of
&gt; a time duration?

Nope, it&apos;s still an open issue here and for enforcing minimum delays in loops.

&gt; I prefer the use of a time duration (gives the implementation more flexibility
&gt; to be sample-rate-independent), and I thought the discussion on the mailing
&gt; list about the minimum delay for DelayNodes was heading that way.

What do you mean by sample-rate-independent in this context?

If two implementations running at the same sampling rate don&apos;t sample AudioParam at exactly the same interval (in samples) then they won&apos;t sound the same. My favorite example is when the AudioParam is a high-frequency sine wave, where the result of sampling every n samples and every n+1 samples may be audibly different. I think that in order to define the sampling in terms of seconds, the AudioParam must also be correctly down-sampled to avoid this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69101</commentid>
    <comment_count>10</comment_count>
    <who name="Robert O&apos;Callahan (Mozilla)">roc</who>
    <bug_when>2012-06-15 16:39:25 +0000</bug_when>
    <thetext>OK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75465</commentid>
    <comment_count>11</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-10-06 01:14:50 +0000</bug_when>
    <thetext>Fixed:
https://dvcs.w3.org/hg/audio/rev/b70ebeca5d18</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76087</commentid>
    <comment_count>12</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-10-12 11:48:10 +0000</bug_when>
    <thetext>Looks good now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114014</commentid>
    <comment_count>13</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2014-10-28 17:16:41 +0000</bug_when>
    <thetext>Closing. See https://github.com/WebAudio/web-audio-api/issues for up to date list of issues for the Web Audio API.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>