web-audio-components / component.fm

Site code for Component.fm.
http://component.fm
MIT License
11 stars 1 forks source link

The site is using the synchronous AudioContext.createBuffer method #2

Open padenot opened 11 years ago

padenot commented 11 years ago

We are going to remove this method from the spec (and from implementations, although I can only speak for Firefox, here), because this method is very bad for browser/website responsiveness (because by running on the main thread, it prevents Javascript and other main thread stuff to execute).

We have written a little MDN page to give a couple advices to port code using webkitisms to make it spec-compliant 1, if you feel the need. Here, you want to use the AudioContext.decodeAudioData(buffer, callback) method. Since it is asynchronous, we can kick off a thread to do the decoding, notify your script when it is done, and your website keeps being responsive.

Keep up to good work, I'm excited about component.fm and the whole WebAudio component affair :-).

jsantell commented 11 years ago

Oh, will do! Also noticed something changed in the last week or so (between 7/3/2013 and 7/6/2013) in the nightlies causing this to stop working in FF -- will have to dig into that too