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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>74030</bug_id>
          
          <creation_ts>2011-12-07 15:25:33 -0800</creation_ts>
          <short_desc>Webaudio IDL descriptions may not match implementation</short_desc>
          <delta_ts>2013-05-10 18:04:52 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Audio</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</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>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Raymond Toy">rtoy</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>crogers</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>516948</commentid>
    <comment_count>0</comment_count>
    <who name="Raymond Toy">rtoy</who>
    <bug_when>2011-12-07 15:25:33 -0800</bug_when>
    <thetext>Consider the description for AudioBufferSourceNode at 
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioBufferSourceNode-section

The IDL for noteGrainOn says floats are taken for the parameters.  But the actual implementation for noteGrainOn in AudioBufferSourceNode.cpp takes doubles.  I think this means that the javascript floats (64-bit precision floats) are converted to single-precision floats which are then coerced back to double floats.  (This causes a loss of precision.)

I think these should be made consistent.  Either the IDL should specify double floats or the C++ implementation should take floats.

See http://code.google.com/p/chromium/issues/detail?id=106147 for an example of what can happen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518978</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2011-12-11 19:37:58 -0800</bug_when>
    <thetext>I agree.  I think the IDL should be changed to double.

In fact, any API involving time values or durations should be changed to double.  I&apos;ve seen similar types of rounding problems in the past when dealing with time (especially cumulative time), significant time drift due to lack of precision, etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>519341</commentid>
    <comment_count>2</comment_count>
    <who name="Raymond Toy">rtoy</who>
    <bug_when>2011-12-12 10:50:30 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; I agree.  I think the IDL should be changed to double.
&gt; 
&gt; In fact, any API involving time values or durations should be changed to double.  I&apos;ve seen similar types of rounding problems in the past when dealing with time (especially cumulative time), significant time drift due to lack of precision, etc.

Great!  I&apos;ll make a patch soon where all the IDL uses doubles (except, of course, the Float32Array stuff).  I&apos;ll also send an update for the webaudio spec to use doubles.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>887712</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2013-05-10 18:04:52 -0700</bug_when>
    <thetext>Both the spec and the .idl now use doubles so closing</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>