WebAPI/AudioChannels: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:


The channels are:
The channels are:
* telephony (used by both normal telephony calls, as well as VoIP calls)
https://etherpad.mozilla.org/sound-stream-types
* alarm (not muted when the device is muted)
* attention (used by phone ringer)
* speakernotify (useful for camera "click" sounds etc).
* normal
 
We probably need more channels here. And I'm not sure about the priority.


We'll have separate mute and volume settings per channel.  
We'll have separate mute and volume settings per channel.  

Revision as of 02:30, 8 November 2012

This API introduces the concept of a hierarchy of audio channels. The channels are prioritized as to allow "silencing all channels with priority lower than X".

The channels are: https://etherpad.mozilla.org/sound-stream-types

We'll have separate mute and volume settings per channel.

Open questions

Do we need the ability to play audio through the normal audio channel or through speaker even when headphones/headset is plugged in? That seems useful for alarms. Maybe the "alarm" channel never plays through headphones/headset?

API

interface AudioChannelManager : EventTarget {
 muteChannelsBelow(DOMString type);
 unmuteChannels();
 readonly attribute DOMString[] mutedChannels;
 attribute EventHandler onmutedchange;

 readonly attribute boolean headphones;
 attribute EventHandler onheadphoneschange; // Always fired before audio start playing through the new channel

 attribute boolean speaker;

 attribute DOMString volumeControlChannel; // The channel whose volume is changed if the user presses the volumeup/down buttons.
}