2015-08-28 02:56:35 +00:00
|
|
|
define(["Tone/effect/Convolver", "helper/Basic", "helper/EffectTests", "Tone/core/Buffer"],
|
|
|
|
function (Convolver, Basic, EffectTests, Buffer) {
|
|
|
|
describe("Effect", function(){
|
|
|
|
|
2015-08-28 03:02:08 +00:00
|
|
|
Basic(Convolver);
|
2015-08-28 02:56:35 +00:00
|
|
|
|
|
|
|
var ir = new Buffer();
|
|
|
|
|
|
|
|
before(function(done){
|
|
|
|
ir.load("./audio/berlin_tunnel_ir.wav", function(){
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2015-08-28 03:02:08 +00:00
|
|
|
EffectTests(Convolver, undefined, function(conv){
|
|
|
|
conv.buffer = ir;
|
|
|
|
});
|
2015-08-28 02:56:35 +00:00
|
|
|
|
|
|
|
context("API", function(){
|
|
|
|
|
2015-08-28 03:02:08 +00:00
|
|
|
it ("can pass in options in the constructor", function(){
|
2015-08-28 02:56:35 +00:00
|
|
|
var convolver = new Convolver({
|
2015-08-28 03:02:08 +00:00
|
|
|
"url" : "./audio/berlin_tunnel_ir.wav",
|
2015-08-28 02:56:35 +00:00
|
|
|
});
|
|
|
|
convolver.dispose();
|
|
|
|
});
|
|
|
|
|
2015-08-28 03:02:08 +00:00
|
|
|
it ("invokes the onload function when loaded", function(done){
|
|
|
|
var convolver = new Convolver({
|
|
|
|
"url" : "./audio/berlin_tunnel_ir.wav",
|
|
|
|
"onload" : function(){
|
|
|
|
convolver.dispose();
|
|
|
|
done();
|
|
|
|
}
|
2015-08-28 02:56:35 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|