Advice on the convolver node

Hi!

I've been playing around with the convolver node in the Web Audio API. 
The examples I could find load an impulse response into the convolver 
node by making an XHR request to a URI to a wav file, e.g. (from [1]):

function loadImpulseResponse(url, convolver) {
     var request = new XMLHttpRequest();
     request.open("GET", url, true);
     request.responseType = "arraybuffer";

     request.onload = function() {
         convolver.buffer = context.createBuffer(request.response, false);
         isImpulseResponseLoaded = true;
     }
     request.onerror = function() {
         alert("error loading reverb");
     }

     request.send();
}

var convolver = context.createConvolver();
loadImpulseResponse('impulse-responses/matrix-reverb6.wav', convolver);


My question - is it possible to set the convolver buffer from a regular 
javascript array? For example to generate the impulse response using 
Math.sin()?

Best regards,

Chris

[1] - 
http://chromium.googlecode.com/svn/trunk/samples/audio/wavetable-synth.html


-- 
Chris Lowis
Research Engineer, BBC R&D (Central Labs)
7th Floor, Henry Wood House, 3-7 Langham Place, London. W1A 1AA
Tel: 020 7765 0854

Received on Tuesday, 20 March 2012 16:29:58 UTC