mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
set original context even after test failure
This commit is contained in:
parent
d3cb326a36
commit
1601c1f4ac
2 changed files with 13 additions and 2 deletions
|
@ -24,7 +24,12 @@ define(["Tone/core/Tone"], function (Tone) {
|
|||
for (var k = j - rmsFrame; k < j; k++){
|
||||
sum += buffer[k] * buffer[k];
|
||||
}
|
||||
try {
|
||||
this._test(Math.sqrt(sum / rmsFrame), j / sampleRate);
|
||||
} catch (e){
|
||||
Tone.setContext(onlineContext);
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
this._after();
|
||||
|
|
|
@ -29,7 +29,13 @@ define(["Tone/core/Tone"], function (Tone) {
|
|||
if (channels === 1) {
|
||||
ret = ret[0];
|
||||
}
|
||||
try {
|
||||
this._test(ret, i / sampleRate);
|
||||
} catch (e){
|
||||
//reset the old context
|
||||
Tone.setContext(onlineContext);
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
this._after();
|
||||
//reset the old context
|
||||
|
|
Loading…
Reference in a new issue