2015-08-28 02:56:35 +00:00
|
|
|
define(["Tone/effect/Convolver", "helper/Basic", "helper/EffectTests", "Tone/core/Buffer"],
|
|
|
|
function (Convolver, Basic, EffectTests, Buffer) {
|
2016-08-09 18:25:20 +00:00
|
|
|
|
|
|
|
if (window.__karma__){
|
|
|
|
Buffer.baseUrl = "/base/test/";
|
|
|
|
}
|
|
|
|
|
2016-08-09 18:59:38 +00:00
|
|
|
describe("Convolver", function(){
|
2015-08-28 02:56:35 +00:00
|
|
|
|
2015-08-28 03:02:08 +00:00
|
|
|
Basic(Convolver);
|
2015-08-28 02:56:35 +00:00
|
|
|
|
|
|
|
var ir = new Buffer();
|
|
|
|
|
2016-08-09 18:25:20 +00:00
|
|
|
var testFile = "./audio/sineStereo.wav";
|
2016-03-05 05:07:17 +00:00
|
|
|
|
2015-08-28 02:56:35 +00:00
|
|
|
before(function(done){
|
2016-03-05 05:07:17 +00:00
|
|
|
ir.load(testFile, function(){
|
2015-08-28 02:56:35 +00:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-08-09 20:47:14 +00:00
|
|
|
// EffectTests(Convolver, 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({
|
2016-03-05 05:07:17 +00:00
|
|
|
"url" : testFile,
|
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({
|
2016-03-05 05:07:17 +00:00
|
|
|
"url" : testFile,
|
2015-08-28 03:02:08 +00:00
|
|
|
"onload" : function(){
|
|
|
|
convolver.dispose();
|
|
|
|
done();
|
|
|
|
}
|
2015-08-28 02:56:35 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|