howler.js icon indicating copy to clipboard operation
howler.js copied to clipboard

Muted howler still clicks speakers when play() is called

Open brian-man opened this issue 2 years ago • 1 comments

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

brian-man avatar Apr 22 '23 19:04 brian-man

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?

rferrari avatar Sep 08 '24 21:09 rferrari