110 comments

[ 2.2 ms ] story [ 181 ms ] thread
Finally, a way to know what stupid portfolios have automatic music so I can close them without even looking and thus jot being tempted to hire people that do that.
that's why you need to hire me ! i dont.
I am excited about this feature. Its really useful when you have tabs that autoplay some sound and you are hunting around to close that tab. Also, if you use grooveshark or some other music service and its in the browser.
This is more exciting than half of the features in HTML5.
No kidding! This is like the incognito tab. No idea how web browsers went so long without it.
Read the other comments. This requires the Pepper plugin API. This is not backward compatible with NPAPI where system calls are made by the plugin itself.
Only if it works reliably though. I wonder whether they can make it work with plugins.

Maybe you'd have to get a hook with some platform specific OS API that tells you when sound is playing (does this even exist though)? You could then match this to user interactions within the browser - did the user click inside my browser window when the event started? Then it's probably happening within that tab and I'm gonna show him that animation. False positives wouldn't be very harmful here, so you could let that slip.

Yes, on Windows you can intercept/hook the Audio API and know where the calls came from.

My company has done that for multiple applications: http://www.nektra.com/products/audio-recorder-api/

Remember that on Google Chrome there is a separation of processes so you can differentiate what tab iis related to the sound.

It seems like it would be a nice feature on multiple monitors to use stereo/3D sound to locate an alert sound coming out of a window.

For instance, if it's on the extreme side of the right monitor, play a sound in the right speaker.

Latest AMD video cards have independent audio device for every connected via DisplayPort display (up to 6) and support switching sound output between them depending on positions of windows in Windows drivers. So if sound comes from application with window on the right monitor it would be played in speakers connected to the right monitor.
Interestingly enough, the Rollercoaster Tycoon games (1 and 2 at least) did this for UI sounds. (I also recall reading this had been a feature of some OS of yonder.)
>Remember that on Google Chrome there is a separation of processes so you can differentiate what tab iis related to the sound.

Unfortunately, it doesn't work that way. While Chrome can run each tab in its own process, all Flash gets run through a single Flash process.

There's only one plugin that people actually use, Flash, and that runs in a NaCl sandbox anyway. So there is no need for any hacks to get this to work.
Flash runs in the Pepper/PPAPI sandbox, not NaCl. Your confusion is understandable, however, since the first version of Pepper was the browser API layer for NaCl. The difference is that NaCl applies an inner sandbox layer that's much stricter than the sandbox used for Pepper Flash (or normal Chrome web content for that matter).
Ah, interesting. At least reading the public Pepper docs, it seems like there is a hook where the browser requests audio from the plugin/NaCl app/whatever. Is that how Flash gets its audio data into the host's audio subsystem?
That's basically what the MuteTab Chrome extension does (although since extensions don't have access to OS functions, it doesn't tell you if anything is playing a sound or not.)

But with the new code they at the very least have it working with Flash. You can try it out right now by downloading a canary build and going to a Flash site (such as homestarrunner.com.)

The reason it works now while it didn't before is that they are passing extra information between Chrome and Flash so that Chrome can keep track of which Flash instances are making sound.

Edit: Thanks justinschuh for being more specific as to how this communication happens.

I mentioned in reply to you below, but it works for PPAPI plugins because they use Chrome's IO/system stack (since the sandbox prevents direct system access). Examples of PPAPI plugins include Flash, NaCl, Netflix on Chrome OS, etc.
> although since extensions don't have access to OS functions, it doesn't tell you if anything is playing a sound or not

and that's why this should be a browser feature and not an extension.

Agreed. MuteTab development was started back in Fall 2010 when it wasn't clear to me if Adobe would ever work toward making the changes required to enable such a feature.

The extension may live on if there are features that people want but that Google decides do not need to be a part of the browser.

Safari won't run any flash animation until you actually have the tab active and is pretty reliable. I'll be happy if they do that.
I've never run Safari and I find this interesting. So if the tab is say, torn apart and put on a second monitor (which is visible), but you're working on another tab, does it literally pause the animation halfway?
I'm pretty sure it's just starting the animation.
Can confirm this. It was a good feature when using youtube. I usually search for something then shift+click about 4-5 links and watch them one by one. In chrome you have to go into each on of those tabs and pause the video to avoid a clusterf*ck of different sounds. With safari it seems to do it automatically.
Why shift+click? Don't you like tabs (ctrl+click)?
isn't that flash plugin features ? It's a big problem with flash game on Kongregate for a long time now.
I'd not want this for audio, what about pandora in a tab, I don't want it active to listen to the music.
It won't start the animation until you view the tab, but it will continue to play it when you move away.
On a somewhat related note, while an audio indicator is a nice addition, autoplay itself should really be a user controllable browser setting.
Chrome has a click to play feature under plugins.
I turned this on a few days ago after all the high profile drive-by hackings. I couldn't be more happy with the results. I've added exceptions for youtube, reddit and a few other sites but I feel a lot safer browsing the web now!
But it only works on plugins, not <video>
(comment deleted)
Even better would be a play/pause button... or is that not feasible? I'm not so familiar with browser development.
Perhaps a mute/unmute would be more feasible.
Or a per-tab volume control. Volume control for HTML5 videos, games, etc. has always seemed to me like something that belongs in the browser chrome, not inside the tab itself.

(Really, this is another way to say, "I'm a lazy HTML5 developer and I think having to create a 'sound-effects preferences' view on every project I do is a bit silly, if the browser could just be handling it for me." ;)

PulseAudio, I already get that for free :) The default KMix app in KDE presents app volume sliders as well as the Master audio slider in the tasktray icon. One of my absolute favorite linux features, especially since I pass through my Xbox and I can control it too.
(comment deleted)
Oh, Windows does it too--but that's per app, not per tab. Apparently quite a few people like to listen to music on youtube while playing my game with the volume off :)
It's probably not feasible, because you'd have to pause the entire document, including all scripts. And since there are ways for scripts to communicate synchronously across documents, you could end up with seemingly unrelated tabs paused.
Thank you google! I was just thinking about this problem the other day and was even contemplating trying to build something myself but then realized I probably just shouldn't have so many tabs open.
(comment deleted)
I like the idea but hope that they do not use the current implementation. A moving "favicon" will add visual clutter.
I would also love a simple indicator of which tabs are 'busy' consuming cycles or generating garbage, so I know which tabs to kill first to get back to acceptable performance. (Perhaps even just a rough indicator of how many setTimeout()s are originating from a page would be enough.)
Use the Chrome Task Manager. You can get to it via the Tools menu, or a keyboard shortcut (shift+esc on Windows).
s/love/love in Firefox/

...as I meant to imply by replying under an FF issue.

But speaking of Chrome, I'd prefer the activity indicator in the tabs themselves... mapping the Task Manager names to my many tabs distinguishable only by not-necessarily-unique favicons is a pain.

I wish there was a simple way to suspend all open tabs. I really have no need to refreshing disquis-comments or some crazy scripts that track my mouse pointer to generate heat maps.

I even tried to write a little chrome extension which injects a content script into every open tab, which calls settimer to get the highest timer-id and kills all timers with ids from 1 to this id. But for some reason it didn't work.

I'm curious if it will be possible to get this feature working in Firefox. Since other posts here indicate that this was possible for Flash because it is using the Pepper stack and since Firefox has said they do not plan to adopt Pepper (https://bugzilla.mozilla.org/show_bug.cgi?id=729481), I wonder how possible this will be.

This feature could significantly negatively affect Firefox's market share.

The bug indeed seems to conclude it's impossible until Flash is eradicated, though disabling Flash in anything but the foreground tab + click to play will probably make it moot. (Apparently Safari does exactly this)

There's alternatives such as Shumway.

Also, in my experience lack of Flash or it crashing is seen as a way bigger problem than nasty tabs, as of now.

Shumway is a more direct route to solving this problem than reverse engineering the Pepper API. The Shumway approach has several other advantages too, such as portability and unifying the graphics/audio/JIT stacks of the browser and Flash. Assuming Shumway works out (that's a big assumption, but so is assuming that Pepper could be reverse engineered and shipped), I don't see any technical obstacles to Firefox doing this as well.
I wrote the MuteTab Chrome extension (http://www.mutetab.com/) and have been following the development of this feature in Chrome's bug tracker.

The reason this feature hasn't existed is that Chrome (like all browsers other than IE) would use just a single instance of Flash for all tabs so the browser could not control the volumes independently nor tell which Flash instances were playing sound or might ever play sound. You can read this explanation from Chrome devs here: http://www.reddit.com/r/IAmA/comments/gdyun/iama_we_are_thre...

My understanding (just from reading comments in the bug tracker) is that Google was able to get Adobe to cooperate with them and add some hooks so they could keep track of the sounds for each Flash plug-in separately.

I was able to try this feature out in today's Canary build and it worked for me on the two sites I tried it on: youtubedoubler.com and homestarrunner.com.

The URL chrome://media-internals is also interesting in that it will show an entry for each plug-in instance browser-wide. Hopefully they will have a UI element similar to this or like MuteTab so that a person can find the tab making sound when they have a huge number of tabs open in multiple windows and cannot see all of the audio indicators.

This is one of the benefits of our work to sandbox Flash. In order to support the sandbox we had to broker out all IO and system access by porting to PPAPI. So, this means that everything goes through Chrome's stack and we can control it much like web content content. Unfortunately, this doesn't work for NPAPI plugins since they don't go through Chrome's stack.
Sweet. It would be better if we can mute it by a single click.
I wonder if this has anything to do with the Google version of Flash (called "Pepper") that Chrome now includes -- if that will be used as a special hook or something. Or if there's another way to do it.
For Flash it does. Since Pepper plugins use our system/IO stack we can handle them much the same way we do normal web content.
Fantastic news.

Trying to figure out which page is making noise, was most of the reason for installing an ad blocker.

Isn't the fact that we're all so excited by this hampered by the fact that it sucks that Chrome automatically starts youtube videos when you open the tab and that's the only reason we need this.
Use Chrome's "click to play" feature or extensions such as Flashblock or "Stop Autoplay" if this is your problem. This feature is more useful generally.
If this works reliably, what a feature! I've been wondering for years why browsers didn't show you what tabs were making noise, I'm glad it's a reality now.
Sounds can be annoying, but the top problem for me in Chrome are still accidental clicks on close button when there's lot of tabs open. A simple option to hide the close buttons on all inactive tabs would save a day, but I guess it's not "challenging" enough feature for Google engineers...
This isn't what you asked for, but you can unclose a tab by pressing Ctrl-Shift-T
Or in the new tab window in the bottom right there is "Recently Closed" where you can unclose tabs and groups of tabs.
I found a chrome extension a few months ago that does a lot of this. It's called MuteTab and bills itself as 'browser-wide granular sound management for chrome'. It's not perfect with flash, but makes a huge difference. http://www.mutetab.com/

EDIT: here's the github - https://github.com/PhilGrayson/MuteTabs

That is not the github. That project is "MuteTabs" which is different than MuteTab.
If you are excited with this feature, you should probably try "click to play" for plugins.
This. Click to play solved this problem since a long time. For me the noise of a website isn't the music, it's the advertising.
The main use I have for the new Chrome feature wouldn't be to find out where audio was playing that I hadn't started, it would be to find out which tab was playing audio if I had lots of YouTube tabs open and I couldn't remember which one I had played.
That's the first thing that came to my mind too. I can't remember the last time I had this problem. Click to play + AdBlock = no unknown sounds.
While I'll be glad for the audio indicators why not just mute every tab by default? Any user interaction on a page would unmute that tab.

Can I also get a bandwidth/data transfer rate indicator per tab too?

I often listen to Grooveshark or Youtube on an invisible tab.
Great news. An indicator for CPU usage would be great too.
I would love that too. Blows my mind sometimes how much CPU some pages or sites use. One of my kids plays Moshi Monsters, and that seems to challenge the CPU more than even Far cry 3. Which to me is absurd. I suppose that would be something to do with MM not using the GPU?

So yeah, a CPU indicator in the tab could be handy.

Moshi Monsters must use some very realistic monster fur rendering if it's heavier than Far cry 3 ;)
Dunno mate. But I do wish I could hunt and skin the little buggers, like in FC3!!!
That would actually be a very good thing to have.
Happy to see this. I frequently keep a ton of tabs open and hate being startled by a random one making noise through an ad. In Fact, about a year ago I wrote a sticky note to myself to make this as an extension for a side project. Never did get around to it...
This is pretty great, but I'm dismayed that it's even needed because someone somewhere started the trend of triggering audio without the user's interaction.

"CONGRATULATIONS, YOU'RE A WINNER!"

Congratulations, you're a jackass. You do NOT interrupt Black Sabbath.

Multiple people have pointed out that Chrome has click-to-play for plugins. Great! But now that new HTML5 features (<video>/<audio>/Web Audio API) are widely available and ripe for abuse, will we have any options for disabling autoplay for those?
Firefox lazy-load is still better. Also, Ubuntu's future integration with audio-menu also (why wasn't it done on browser-level?).