mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 16:17:58 +00:00
verifying that all sources can restart
This commit is contained in:
parent
54276555f2
commit
f40958be94
1 changed files with 15 additions and 0 deletions
|
@ -94,6 +94,21 @@ function(OutputAudio, Source, OutputAudioStereo, Test, Offline, APITest){
|
|||
});
|
||||
});
|
||||
|
||||
it("can be restarted", function(){
|
||||
return Offline(function(){
|
||||
var instance = new Constr(args).toMaster();
|
||||
instance.start(0).stop(0.2);
|
||||
instance.restart(0.1);
|
||||
instance.stop(0.25);
|
||||
}, 0.32).then(function(buffer){
|
||||
expect(buffer.getRmsAtTime(0)).to.be.gt(0);
|
||||
expect(buffer.getRmsAtTime(0.1)).to.be.gt(0);
|
||||
expect(buffer.getRmsAtTime(0.2)).to.be.gt(0);
|
||||
expect(buffer.getRmsAtTime(0.23)).to.be.gt(0);
|
||||
expect(buffer.getRmsAtTime(0.3)).to.equal(0);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
context("Source API", function(){
|
||||
|
|
Loading…
Reference in a new issue