How to use the howler.Howler.volume function in howler

To help you get started, we’ve selected a few howler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github melonjs / melonJS / src / audio / audio.js View on Github external
api.load = function (sound, html5, onload_cb, onerror_cb) {
            var urls = [];
            if (typeof(this.audioFormats) === "undefined" || this.audioFormats.length === 0) {
                throw new Error("target audio extension(s) should be set through me.audio.init() before calling the preloader.");
            }
            for (var i = 0; i < this.audioFormats.length; i++) {
                urls.push(sound.src + sound.name + "." + this.audioFormats[i] + me.loader.nocache);
            }
            audioTracks[sound.name] = new Howl({
                src : urls,
                volume : Howler.volume(),
                html5 : html5 === true,
                xhrWithCredentials : me.loader.withCredentials,
                /**
                 * @ignore
                 */
                onloaderror : function () {
                    soundLoadError.call(me.audio, sound.name, onerror_cb);
                },
                /**
                 * @ignore
                 */
                onload : function () {
                    retry_counter = 0;
                    if (onload_cb) {
                        onload_cb();
                    }
github neophob / wpc-emu / client / scripts / lib / sound.js View on Github external
setVolume(floatVolume) {
    console.log('SET MAINVOLUME', floatVolume);
    Howler.volume(floatVolume);
  }
github DeekyJay / SoundwaveInteractive / src / redux / modules / App.js View on Github external
setGlobalVolume: (volume) => {
    Howler.volume(parseFloat(volume) * 0.01)
    return {
      type: constants.SET_GLOBAL_VOLUME,
      payload: {
        globalVolume: volume
      }
    }
  },
  nextTutStep: () => {
github calebomusic / freedm / frontend / components / controls / volume / volume.jsx View on Github external
handleChange(e){
    e.preventDefault();

    const localVolume = parseInt(e.target.value);
    const howlerVolume = localVolume / 10;

    this.setState({volume: localVolume});

    this.props.updateVolume(howlerVolume);
    Howler.volume(howlerVolume)
  }
github GuoGuang / ibole / expansions / music / player.js View on Github external
onvolume() {
            music.state.volume = Howler.volume()
          }
        })