[flocking-users] Audio input with MediaStreamSourceNode

Colin Clark colin at colinclark.org
Sat Apr 5 20:53:26 EDT 2014


Hi all,

Today I added support for the Web Audio API’s MediaStreamSourceNode, which provides audio input in any modern browser. This replaces the lame Flash solution we were using previously. Tests on my MacBook and Chromebook suggest it’s quite effective down to the minimum buffer size supported by the Web Audio API (256 samples). Here are a couple of simple demos:

http://flockingjs.org/demos/interactive/html/playground.html#audioIn
http://flockingjs.org/demos/interactive/html/playground.html#granulatedAudioIn

I haven’t yet had an opportunity to test on Android, iOS, or Firefox OS, so let me know it looks.

This also required some preliminary refactoring of the way nodes are managed in the web audio strategy, which should make simple use cases of inserting nodes before or after the Flocking ScriptProcessorNode easier. Here’s an updated example showing how nodes can be inserted after Flocking; no more monkey patching. Keep in mind that this API will definitely change once “islands” are implemented:

https://gist.github.com/colinbdclark/9179042

Colin


More information about the flocking mailing list