goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
23.94k stars 2.23k forks source link

Muted howler still clicks speakers when play() is called #1655

Open brian-man opened 1 year ago

brian-man commented 1 year ago

The Problem

When harvesting, logic equivalent to the reduced repro is invoked.

After loading the game or after waiting a minute, the next harvest results in play() being invoked as above. The speaker on my laptop clicks. This suggests to me the speaker is being awoken even though howler is set to muted. In addition to being annoying, this is a waste of battery power.

When muted, howler shouldn't wake up the audio hardware at all.

Reproducible Example

No response

Reproduction Steps

Repro reduced from Sunflower Land:

import { Howler } from "howler";
import harvestMp3 from "assets/sound-effects/harvest.mp3";

export const harvestAudio = new Howl({
  src: [harvestMp3],
  volume: 0.2,
});

Howler.mute(true);

harvestAudio.play();

Possible Solution

No response

Context

No response

Howler.js Version

2.2.3

Affected Browser(s)/Versiuon(s)

Edge (Chromium) / 112.0.1722.34

rferrari commented 1 month ago

same here!

Howler.volume(0.0); var sound = new Howl({src: [ '/soundfx/my_sound.mp3', // clicks speaker here ]});

Looks like its a pulseaudio driver on linux systems. are you using linux?