- From: Gabriel Cardoso <gabriel.cardoso@inria.fr>
- Date: Fri, 24 Feb 2012 15:19:50 +0100
- To: public-audio@w3.org
Hi all, Some feedback on using the Web Audio API to build a online audio worksation => UC3 http://vimeo.com/37250605 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 http://code.google.com/p/chromium/source/browse/trunk/samples/audio/doc/resources/buffer-loader.js). 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, Gabriel
Received on Friday, 24 February 2012 14:20:17 UTC