UNPKG

scratch-gui

Version:

GraphicaL User Interface for creating and running Scratch 3.0 projects

17 lines (12 loc) 422 B
class VolumeEffect { constructor (audioContext, volume) { this.audioContext = audioContext; this.input = this.audioContext.createGain(); this.output = this.audioContext.createGain(); this.gain = this.audioContext.createGain(); this.gain.gain.value = volume; this.input.connect(this.gain); this.gain.connect(this.output); } } export default VolumeEffect;