diff --git a/src/framework/resonator/index.js b/src/framework/resonator/index.js index 0bade61..62577e7 100644 --- a/src/framework/resonator/index.js +++ b/src/framework/resonator/index.js @@ -44,6 +44,7 @@ export default class Resonator { stream(path, type = SourceType.MasterSource) { const element = new Audio(path); element.crossOrigin = 'anonymous'; + element.volume = 1; const source = new StreamingSource(this.graph, this.scene, this.context, element, type); return source; } diff --git a/src/framework/resonator/sources/audio-source.js b/src/framework/resonator/sources/audio-source.js index 5452771..2828713 100644 --- a/src/framework/resonator/sources/audio-source.js +++ b/src/framework/resonator/sources/audio-source.js @@ -140,7 +140,7 @@ export default class AudioSource { if (!this.node) { this.play(); } - this.gain.gain.setValueAtTime(0, this.context.getContext().currentTime); + this.gain.gain.setValueAtTime(0.0001, this.context.getContext().currentTime); this.gain.gain.exponentialRampToValueAtTime(this.volume, this.context.getContext().currentTime + time); } } diff --git a/src/framework/resonator/sources/streaming-source.js b/src/framework/resonator/sources/streaming-source.js index 16eb241..39e02c1 100644 --- a/src/framework/resonator/sources/streaming-source.js +++ b/src/framework/resonator/sources/streaming-source.js @@ -84,7 +84,7 @@ export class StreamingSource { if (!this.node) { this.play(); } - this.gain.gain.setValueAtTime(0, this.context.getContext().currentTime); + this.gain.gain.setValueAtTime(0.0001, this.context.getContext().currentTime); this.gain.gain.exponentialRampToValueAtTime(this.getVolume(), this.context.getContext().currentTime + time); } fadeOut(time) {