Since Firefox now supports Web Audio by default, I decided to update all of sorollet.js‘s examples (the two of them) to work with the WebAudio standard AudioContext instead of just using webkitAudioContext. I also added screenshots, which makes it look nicer:
Since sorollet.js is basically an input/output module (you ask it for a number of samples, and it delivers), internally it is totally standards agnostic. The only things I needed to change were pretty much the way the AudioContext and the ScriptProcessor nodes were initialised.
If you need to port webkit- based audio stuff to standards based audio, you can have a look at the article I wrote for the Mozilla Hacks blog.
Funny thing: I found a bug where ScriptProcessor nodes get called even if they are not connected. I prepared a nice test case… only to find the bug was already reported (#916384) and a test case existed. Sigh.
BUT MINE IS COOLER (because it works on Chrome too, and that way you can compare implementations).
Tween.js-ers of the world and interpolation aficionados rejoice!
Here’s tween.js r12: a release that brings you two bug fixes for quite specific circumstances (well spotted, guys!), better assets management for the repo and a C/C++ version for your very binary projects!
Or, copying from the changelog:
- Fix bug with cached tweens.length value inside update() loop (freestlr)
- Move assets and all examples and stuff to use the gh-pages branch, so things are always properly updated (sole).
- Fix bug where chained tweens were not stopped if the previous tween had been stopped, under certain circumstances, by cfddream
- Use tweens in C/C++ with libtween by jsm174!
It’s also in npm as tween.js, so you can do
npm install tween.js
Astute readers might have noticed the absence of an r11 post on this blog. That’s because it was a bit of a messy release, as I was utterly busy, and I forgot to tag it, forgot to add the file size to the change log, etc, etc. Hopefully it’ll get better from now on as I try to simplify the deploy process.
I needed to prepare some slides, but I found the existing HTML+CSS3 systems a tad too complicated for what I needed/wanted. And since I was working on something that used Mozilla Brick components, I decided to see if I could solve this problem, quickly.
Turns out I indeed could! :-)
Within minutes I had assembled this little script that uses x-deck and x-card to display “slides”: here’s the demo.
Thanks to the help and suggestions of Potch I also added proper full screen support. Wenzel suggestions of making a Mozilla themed version was good too. All easily done!
Fact: I actually used a hacked version of this “hack” for my JSConf EU 2013 talk ;-)
We published my first post in the Mozilla Hacks blog today! Its title is Writing Web Audio API code that works in every browser and I’m equally thrilled, excited and honoured to be amongst so many great writers in the blog.
If you’re looking into writing Web Audio code today, in an interoperable manner (i.e. not using webkit prefixes only) I highly recommend you to read it.
I also love that as soon as it was posted, I got a notification that OscillatorNode has passed the technical review and has gone into Nightly. Murphy’s Law at its best, and new toys to play with in Firefox, too! :-D
Here’s to more future Hacks and posts!
As part of some research tasks on how to get existing apps that used the Web Audio API to work with the Firefox implementation, I updated 3400 miles below, one of my WebGL + Web Audio experiments from 2012, so that the early webkit-only code would work with Firefox. I used the same patching library that I used in to_the_beat // js. I also took the opportunity to try out the new Opera, and it works there too. Pretty cool! We are getting closer to the interoperable web utopia!
The source code is available too. It’s quite interesting to look at the diff to get an idea of the sort of changes you need to make to get your old code working in nowadays browsers.
Note that Web Audio is present in Firefox Nightly (v26) or Aurora (v25) for the time being, so if you try this with your normal Firefox or Firefox Beta it won’t work and you’ll get the dreaded message about Web Audio not being supported in your browser. Get a Nightly build here and enjoy the thrill of a freshly baked browser!
I think Web Audio might start to “surface” for the general public some time around November-December of this year, judging by the Release Calendar, but I’m not a release manager, so don’t trust me on that O:-)