UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

33 lines (29 loc) 667 B
export class SoundEmitterChannel { constructor() { /** * Unique name identifying the channel * @type {string} */ this.id = ''; /** * Output to which all sound should be attached to * @type {GainNode} */ this.sink = null; } /** * * @param {number} v */ set volume(v) { // TODO consider if direct writing to .value is handled well on all supported platforms this.sink.gain.value = v; } /** * * @return {number} */ get volume() { return this.sink.gain.value; } }