W3C home > Mailing lists > Public > public-audio@w3.org > January to March 2012

Web Audio API feedback for UC3

From: Gabriel Cardoso <gabriel.cardoso@inria.fr>
Date: Fri, 24 Feb 2012 15:19:50 +0100
To: public-audio@w3.org
Message-ID: <1330093190.31672.178.camel@pachave>
Hi all, 

Some feedback on using the Web Audio API to build a online audio
worksation => UC3


I implemented an object I called ProjectListening dealing with sound
rendering. When instanciated, this object initializes an AudioContext
and loads audio sources from file urls (inspired by

For each track, an AudioGainNode is created and connected to the context
var gainNode = this.context.createGainNode ();
this.gainNodes [track.id] = gainNode;
gainNode.connect (this.context.destination)

Each clip is added to a list in the ProjectListening object. To play the
song, an AudioBufferSource is created (context.createBufferSource ())
for each clips and connected to the AudioGainNode corresponding to its
track. The clip contain information about his position in the track so
notOn can be set.

The AudioBufferSource list is emptied when the song is stopped.

That is almost all I've done so far and I found it very instinctive
(never built an audio app before). 

I am able to control tracks volume (gain actually),
move/remove/duplicate clips.

To mute tracks, I just disconnect the corresponding AudioGainNode from
the context, but when I reconnect it (unmute), all the clips that
haven't been played are all played at the same time ! Is it the expected
behavior ? Should I remove all "past" clips before reconnecting an
audioGainNode ?

I also noticed a slight delay on Chrome Fedora that is not existing on
the Mac OS X version.

That's it for now,

Received on Friday, 24 February 2012 14:20:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:49:58 UTC