Musik bugfixes

This commit is contained in:
silas
2018-10-10 19:27:59 +02:00
parent 7be46f60bb
commit 05188e37fd
3 changed files with 10 additions and 8 deletions

View File

@@ -323,7 +323,7 @@ class AudioChain {
await this.chainFunction(source);
source.start(delay, offset, duration);
this.startTime = (new Date()).getTime();
this.startTime = (new Date()).getTime() - (Helper.nonNull(offset, 0) * 1000);
this.source = source;
this.running = true;
}
@@ -331,13 +331,14 @@ class AudioChain {
async stop(delay) {
if (Helper.isNotNull(this.source)) {
this.pauseTime = ((new Date()).getTime()) - this.startTime;
this.running = false;
return this.source.stop(delay);
}
this.running = false;
return null;
}
async resume() {
if (!this.running) {
return this.start(null, Helper.nonNull(this.pauseTime, 0) / 1000.0);
}