Exposing a playbackPosition property on AudioBufferSourceNode

Hello,

Let me first thank everyone in this group for all the work they've put into
the WebAudioAPI. I'm must say I'm enjoying using the WebAudioAPI both as a
developer and consumer.

I'm trying to implement a interactive effect/synthesis library using the
WebAudioAPI, and I found myself looking for a `playbackPosition` property
on the AudioBufferSourceNode which exposes the sample index which is being
played currently.

A simple use case would be to implement a pause like functionality on
AudioBufferSourceNode, which would allow the playback to resume at the
sample accurate position where it had been stopped (the `offset` property
in the start() method would be handy here) albeit using another instance of
AudioBufferSourceNode. There are many other situations where
AudioBufferSourceNode's playbackPosition would be useful, especially when
used with looping.

Using the currentTime to keep time to calculate the position doesn't work
if the playbackRate of the AudioBufferSourceNode is being changed.

I did find an old email on this list from 2011 talking about this. But
there didn't seem any other discussion about such a property.
http://lists.w3.org/Archives/Public/public-audio/2011OctDec/0143.html

I haven't found any other method to get sample accurate playbackPosition.
Am I missing something? Or is this something that can be added to the WD?

-Chinmay Pendharkar

Received on Saturday, 22 February 2014 22:01:41 UTC