changed music to mp3
This commit is contained in:
@@ -141,14 +141,9 @@ class SoundManager {
|
||||
audioObject.timeOffset = Helper.nonNull(options.timeOffset, audioObject.timeOffset, 0);
|
||||
this.channels[channel] = audioObject;
|
||||
|
||||
console.log(options);
|
||||
|
||||
if (audioObject.muted){
|
||||
this.stop(channel);
|
||||
}
|
||||
else if (Helper.isNotNull(options.muted) && options.muted === false){
|
||||
// this.play(channel);
|
||||
}
|
||||
|
||||
return this.channels[channel];
|
||||
}
|
||||
@@ -167,7 +162,6 @@ 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();
|
||||
@@ -177,6 +171,10 @@ class SoundManager {
|
||||
source.loop = this.channels[channel].loop;
|
||||
gain.gain.value = this.channels[channel].volume;
|
||||
|
||||
//to prevent gap in mp3-files
|
||||
source.loopStart = 0.3;
|
||||
source.loopEnd = buffer.duration-0.3;
|
||||
|
||||
source.connect(gain);
|
||||
gain.connect(this.context.destination);
|
||||
source.start(0);
|
||||
|
||||
Reference in New Issue
Block a user