New issue
Advanced search Search tips

Issue 631277 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Add a speaker icon for AudioContext usage

Reported by tomac...@gmail.com, Jul 26 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36

Example URL:

Steps to reproduce the problem:
Create an AudioContext via console

What is the expected behavior?
Opening an AudioContext and not suspending it uses computer audio resources (specifically power and on mac a no idle sleep assertion). Its proper use (as opposed to OfflineAudioContext) is for playing audio and should be suspended when finished.

I'm not sure if audio being played via an audio context gives the speaker icon or not, but I think it should be given in any case to let users know that resources are being used, and to let developers know to suspend the audio context.

What went wrong?
not sure

Did this work before? N/A 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes 

Chrome version: 51.0.2704.106  Channel: n/a
OS Version: OS X 10.11.1
Flash Version: 

continuation of https://bugs.chromium.org/p/chromium/issues/detail?id=617074&can=2&start=0&num=100&q=&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified&groupby=&sort=
 
Cc: m...@chromium.org
Status: WontFix (was: Unconfirmed)
I don't think there should be a speaker icon for sites that are not actually producing noise. The speaker icon is intended to convey "this tab is making sound", not "this tab  is using your audio hardware". Maybe this error would be worth surfacing in devtools, but I don't think that users will understand seeing a speaker icon for sites that are not making sound, and I don't think adding an always-visible icon in the tab that really wants to be feedback to the site's developer is a good idea either.

Comment 3 by tomac...@gmail.com, Aug 4 2016

Well, the answer regarding why AudioContext uses the audio hardware and blocks sleep is that we don't know that AudioContext is not just about to be producing sound. So it is the developers who ought to be suspending their AudioContext variable when it is not producing sound.

This occurs on a minority of websites (very small) that use AudioContext wrongly. The developers will then correct this issue and the icon will be gone. You might wish to add a console warning for a silent audio context.

Either one or the other is reasonable. There is OfflineAudioContext for uses of silent audio contexts.

Comment 4 by tomac...@gmail.com, Aug 4 2016

There could be a console warning when AudioContext is created to tell the developer that it is using resources and should be suspended when not in use, but this would be distracting to "good" developers who read the spec and those who use it properly. Its not clearly visibile from the AudioContext descriptions that it uses resources (see https://developer.mozilla.org/en-US/docs/Web/API/AudioContext), it is only when you look at ".suspend" that you get a small hint.

Adding the sound icon and/or a warning will be a good way to alert the average developer that they should not be holding on to a live AudioContext reference if they aren't using it.


Sign in to add a comment