WebAPI/AudioChannels

From MozillaWiki
< WebAPI
Revision as of 23:39, 7 November 2012 by Sicking (talk | contribs) (Created page with "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:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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:

  • telephony (used by both normal telephony calls, as well as VoIP calls)
  • alarm
  • speakernotify (useful for camera "click" sounds etc).
  • normal

We probably need a bunch more channels here. And I'm not sure about the priority.

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);
 readonly attribute DOMString[] mutedChannels;
 attribute EventHandler onmutedchanged;

 readonly attribute boolean headphones;

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