Lautstärke angepasst
This commit is contained in:
@@ -171,10 +171,16 @@ class SoundManager {
|
||||
if (!this.channels[channel].muted) {
|
||||
let buffer = await this.channels[channel].loadedPromise;
|
||||
let source = this.context.createBufferSource();
|
||||
let gain = this.context.createGain();
|
||||
|
||||
source.buffer = buffer;
|
||||
source.connect(this.context.destination);
|
||||
source.loop = this.channels[channel].loop;
|
||||
gain.gain.value = this.channels[channel].volume;
|
||||
|
||||
source.connect(gain);
|
||||
gain.connect(this.context.destination);
|
||||
source.start(0);
|
||||
|
||||
this.channels[channel].source = source;
|
||||
}
|
||||
return this.channels[channel];
|
||||
|
||||
Reference in New Issue
Block a user