Muhammad Umer
Muhammad Umer

Reputation: 18097

chrome extension: how to mute all audio from certain tab

I have been searching for something in chrome extension reference to find anything that would allow me to manipulate audio level of a tab. Only option that has come to my mind is make script have it go through all elements in page and either remove them or mute them if possible.

But i feel there has to be a way to reroute all audio streams to nothing, like break them from output which is speakers if using audio api of html5...however no avail either with chrome extension apis or web audio api.

Goal: mute all sounds on page (flash, audio element, etc.)

Upvotes: 4

Views: 3859

Answers (2)

German Rumm
German Rumm

Reputation: 5812

There's now a Chrome extension allowing to mute websites by URL using blacklist/whitelist approach called "Mute Tabs by URL".

It does require you to allow it to read your 'browsing history', but description swears that it doesn't store your URLs anywhere, and event points to a location of source code, so you can verify it for yourself

Upvotes: 1

Jared Sohn
Jared Sohn

Reputation: 444

You cannot do this now, although this will hopefully change in the near-term future.

At the moment, there is nothing in the Chrome APIs, although I did propose a tabaudio API back in February (and am working on a new draft -- as well as an implementation -- right now.)

Can you give me an idea as to what you want this functionality for? (They ask for potential uses when proposing APIs.)

Perhaps the closest that you can do is something similar to what the MuteTab Chrome extension does (written by me, http://www.github.com/jaredsohn/mutetab), which basically scans the page for object, embed, audio, video, and applet tags and hides them from the page. Unfortunately, this misses web audio. Also, instead of muting, it "stops" it by removing it from the page, which could block the video or game associated with the sound. Alternatively, if you just care about HTML5 video or audio or Flash that has an API (such as YouTube), you could could use JavaScript to pause or mute things.

Upvotes: 4

Related Questions