6

Is there a way to programmatic-ally control audio level on tabs i want to regardless of how web app was designed (be it HTML5 Audio element or Flash, etc.)?

Just to make it clear i don't intend to research web page for some "id" "elements" or whatsoever, but something like Chrome.ThisAudioOutputLevels...?

2 Answers2

6

Admitting that the audio comes from a <audio> HTML element, you can try to get all audio elements from the DOM and lower their volumes. I was suffering from this with google hangouts meetings where I couldn't lower the audio because it had no control whatsoever.

"The solution"

I selected all <audio> elements and lowered their volumes. Follow these steps:

  1. Open your console on the given tab. (Press F12).
  2. Select all audio elements.
  3. Lower each audio volume.
let audios = [...document.getElementsByTagName('audio')];
audios.forEach(audio => audio.volume = 0.5) // lower volume 50%.

Volume range = {0..1} where 0 = no volume.

Diogo Mafra
  • 449
  • 5
  • 9
  • 2
    Composed as a 1-liner for quick copy-paste: `[...document.getElementsByTagName('audio')].forEach(a => a.volume = 0.5)` – Ben Zenker Jun 30 '20 at 15:07
2

This is more of a comment than an answer, but I can't comment, so:

Browsers generally try not to change how the content is meant to be displayed, including sound. For this reason, I would be surprised if there were such a feature.

If you're trying to simply mute tabs, you could take a look at chrome://flags/#enable-tab-audio-muting

Alternatively you could use tampermonkey or a similar extension and run a search for all audio/video tags and change the volume, but you said you didn't want to search for specific elements. To my knowledge (and Google's) as of right now there is no volume control for an entire page.

nickRise
  • 96
  • 1
  • 6
  • Browser width and height can be adjusted including zooming in/out in most decent browser, why not to "tamper" with sound? –  Jul 28 '15 at 14:07
  • Because of reasons. Maybe someone at google could tell us what those might be. – nickRise Jul 28 '15 at 23:40