Musikbuttons hinzugefügt
This commit is contained in:
@@ -139,12 +139,16 @@ class SoundManager {
|
||||
audioObject.volume = Helper.nonNull(options.volume, audioObject.volume, 1);
|
||||
audioObject.loop = Helper.nonNull(options.loop, audioObject.loop, false);
|
||||
audioObject.timeOffset = Helper.nonNull(options.timeOffset, audioObject.timeOffset, 0);
|
||||
this.channels[channel] = audioObject;
|
||||
|
||||
console.log(options);
|
||||
|
||||
if (audioObject.muted){
|
||||
this.stop(channel);
|
||||
}
|
||||
|
||||
this.channels[channel] = audioObject;
|
||||
else if (Helper.isNotNull(options.muted) && options.muted === false){
|
||||
// this.play(channel);
|
||||
}
|
||||
|
||||
return this.channels[channel];
|
||||
}
|
||||
@@ -163,13 +167,12 @@ class SoundManager {
|
||||
this.stop(channel);
|
||||
this.set(audioOrOptions, channel);
|
||||
|
||||
console.log(this.channels[channel]);
|
||||
if (!this.channels[channel].muted) {
|
||||
let buffer = await this.channels[channel].loadedPromise;
|
||||
let source = this.context.createBufferSource();
|
||||
source.buffer = buffer;
|
||||
source.connect(this.context.destination);
|
||||
// source.loopStart = 5;
|
||||
// source.loopEnd = 5;
|
||||
source.loop = this.channels[channel].loop;
|
||||
source.start(0);
|
||||
this.channels[channel].source = source;
|
||||
|
||||
Reference in New Issue
Block a user