Chrome扩展程序:如何将特定标签中的所有音频静音 [英] chrome extension: how to mute all audio from certain tab

查看:211
本文介绍了Chrome扩展程序:如何将特定标签中的所有音频静音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找铬扩展参考的东西来找到任何可以让我操纵标签音频级别的东西。我想到的唯一选择是让脚本让它遍历页面中的所有元素,并将它们移除或在可能的情况下将其静音。



但我觉得必须是一种将所有音频流重新路由为无的方式,例如,如果使用html5的音频api将其从输出中分离出来,然而无法使用Chrome扩展apis或web音频api。



目标:将页面上的所有声音(flash,audio element等)静音现在,尽管这将有望在短期内改变。

目前,Chrome API没有任何内容,尽管我确实提出了一个tabaudio API在2月份(现在我正在研究一个新的草案 - 以及一个实现 - )。

你能给我一个关于你想要什么的想法吗?功能为? (他们在提出API时要求潜在用途。)



也许最接近的做法与MuteTab Chrome扩展所做的相似(由我写的 http://www.github.com/jaredsohn/mutetab ),它基本上扫描对象的页面,嵌入,音频,视频和小应用程序标签,并将其隐藏在页面中。不幸的是,这忽略了网络音频。此外,不是静音,而是通过从页面中移除它来停止它,这可以阻止与声音相关的视频或游戏。或者,如果您只关心HTML5视频或音频或具有API的Flash(如YouTube),则可以使用JavaScript来暂停或静音。


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.)

解决方案

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.

这篇关于Chrome扩展程序:如何将特定标签中的所有音频静音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆