1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // The <code>chrome.audio</code> API is provided to allow users to
6 // get information about and control the audio devices attached to the
7 // system. This API is currently only implemented for ChromeOS.
10 dictionary OutputDeviceInfo
{
11 // The unique identifier of the audio output device.
13 // The user-friendly name (e.g. "Bose Amplifier").
15 // True if this is the current active device.
17 // True if this is muted.
19 // The output volume ranging from 0.0 to 1.0.
23 dictionary InputDeviceInfo
{
24 // The unique identifier of the audio input device.
26 // The user-friendly name (e.g. "USB Microphone").
28 // True if this is the current active device.
30 // True if this is muted.
32 // The input gain ranging from 0.0 to 1.0.
36 dictionary DeviceProperties
{
37 // True if this is muted.
39 // If this is an output device then this field indicates the output volume.
40 // If this is an input device then this field is ignored.
42 // If this is an input device then this field indicates the input gain.
43 // If this is an output device then this field is ignored.
47 callback GetInfoCallback
= void(OutputDeviceInfo
[] outputInfo
,
48 InputDeviceInfo
[] inputInfo
);
49 callback SetActiveDevicesCallback
= void();
50 callback SetPropertiesCallback
= void();
53 // Get the information of all audio output and input devices.
54 static
void getInfo
(GetInfoCallback
callback);
56 // Select a subset of audio devices as active.
57 static
void setActiveDevices
(DOMString
[] ids
,
58 SetActiveDevicesCallback
callback);
60 // Sets the properties for the input or output device.
61 static
void setProperties
(DOMString
id,
62 DeviceProperties properties
,
63 SetPropertiesCallback
callback);
67 // Fired when anything changes to the audio device configuration.
68 static
void onDeviceChanged
();