W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2012

Safari's Web Audio vs Chrome's

From: Yotam <matoyotambien@gmail.com>
Date: Fri, 21 Sep 2012 13:20:21 -0400
Message-Id: <E5A9FD53-6A16-4362-97F4-600BC10354E5@gmail.com>
To: public-audio@w3.org
Hi Group, 

I have a question regarding the differences between Safari vs Chrome's implementation of Web Audio. I have been working on creating interactive music in the browser using the audio API. The most recent song takes users on an intergalactic ride, putting them in control of the sonic energy of the music by manipulating the speed of the spaceship. 

The song crossfades 9 mediaElementSourceNodes as the speed changes and plays a corresponding visual of flying through space using Three.js. Definitely heavy on the CPU. Chrome seems to handle this well even though it's using up almost all of my processor(s); there are rarely any glitches in the audio and it doesn't fall out of sync almost ever (though i detect and correct this situation when it happens). 

Safari is a whole other story. The audio starts out of sync and never gets in sync. The crossfades (using the audioGainNode) don't seem to work and they don't initialize to the correct state so when it starts all of the tracks are playing (out of sync with each other, which makes for a very trippy sound, but not the sound that I'm after). 

So far i've been browser detecting to deny anyone not using Chrome. I would like to change browser-detection to feature-detection and throw a message when people don't have Web Audio, but first I need to get this Safari issue sorted out. 

Here is the site without the browser detection enabled. check it out on Chrome and then Safari to hear the difference. 

http://beta.dutchgramophone.com/rocketship/safari.html

I'm wondering if other people have noticed the big differences in the implementations, or if there are any things that i should be doing differently to make it work on both browsers? 

Any advice is greatly appreciated. 

Thanks. 

Yotam
Received on Friday, 21 September 2012 17:20:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 21 September 2012 17:20:52 GMT