This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17401 - (AudioBufferDirectAccess): AudioBuffer direct access
Summary: (AudioBufferDirectAccess): AudioBuffer direct access
Status: CLOSED WONTFIX
Alias: None
Product: AudioWG
Classification: Unclassified
Component: Web Audio API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: TBD
Assignee: Chris Rogers
QA Contact: This bug has no owner yet - up for the taking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-05 12:27 UTC by Michael[tm] Smith
Modified: 2014-10-28 17:17 UTC (History)
3 users (show)

See Also:


Attachments

Description Michael[tm] Smith 2012-06-05 12:27:00 UTC
Audio-ISSUE-49 (AudioBufferDirectAccess): AudioBuffer direct access [Web Audio API]

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

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

getChannelData is documented as "Gets direct access to the audio data stored in an AudioBuffer" but "direct access" is not defined.

For example, if a reference to an AudioBuffer is kept and the data is modified after the audioprocess event handler has finished running, what will happen?

One approach would be similar to what happens with postMessage and typed arrays, at least in Opera. There, once the ownership of an array is transferred, it becomes a dummy array of length zero that cannot be modified. This does not require copying the memory to achieve "concurrency safety", it is merely a flag on the ECMAScript host object.
Comment 1 Olivier Thereaux 2012-06-07 08:17:20 UTC
[admin] Assigning items currently being worked on by editor.
Comment 2 Olivier Thereaux 2012-06-07 14:58:22 UTC
Changeset from the editor:
https://dvcs.w3.org/hg/audio/rev/5f1f174d7603
Comment 3 Olivier Thereaux 2012-06-07 14:58:58 UTC
More feedback from Philip in http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0485.html


The suggested change effectively requires the audio data to be copied when  
the audioprocess callback returns, which isn't necessary to solve the  
problem. We suggest defining it in terms of ownership transfer,[1] like  
when a typed array is used with postMessage.

In other words, the Float32Array should be neutered, after which reading  
the length property returns 0.[2]

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#transferable-objects
[2] http://www.khronos.org/registry/typedarray/specs/latest/#7
Comment 4 Olivier Thereaux 2014-10-28 17:14:22 UTC
Web Audio API issues have been migrated to Github. 
See https://github.com/WebAudio/web-audio-api/issues
Comment 5 Olivier Thereaux 2014-10-28 17:17:15 UTC
Closing. See https://github.com/WebAudio/web-audio-api/issues for up to date list of issues for the Web Audio API.