New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 680358 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Feature

Blocking:
issue 673392



Sign in to add a comment

audio apps API should treat mute flag as system-wide property

Project Member Reported by tbarzic@chromium.org, Jan 12 2017

Issue description

Currently, mute flag is treated as per audio device property, even though in reality mute is a system property (associated with a type of audio stream rather than a device).
Associating mute with a device makes muting audio input/output non intuitive - one would have to find an active device and change its mute property.

Instead, audio API should expose methods for setting/retrieving mute state per
audio stream type.

For example, getting/setting input mute could be done as:
chrome.audio.getMute('INPUT', function(value) {});
chrome.audio.setMute('INPUT', true, function() {});

Observing mute state is already exposed per audio stream type, but the event name/arguments could be improved up as well.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e

commit 7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e
Author: tbarzic <tbarzic@chromium.org>
Date: Fri Jan 27 04:30:44 2017

chrome.audio API: treat mute as system wide property

As part of audio API cleanup, simplify handling of mute flag.
Current implementation has few problems:
* Setting/getting mute state is done per device, even though mute is
  system property (on the other hand mute state listeners are not
  bound to a specific device).
* Muting input or output is not intuitive - one would have to
  find an active device and set it's mute property - this would also
  set mute for all remaining active devices.

This CL fixes these problems by decoupling mute state setter/getter
from particular device properties, and bounding states to stream type.

Additionally, StreamType enum is introduced - the type specifies type
of stream an audio device supports (input or output) and is intended
to replace existing isInput booleans used across the API.

Existing methods for managing mute state are kept around, but will not
be exposed to stable channel once the API is opened up (modulo
current API whitelist).

BUG= 680358 

Review-Url: https://codereview.chromium.org/2578473002
Cr-Commit-Position: refs/heads/master@{#446592}

[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/extensions/browser/api/audio/audio_api.cc
[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/extensions/browser/api/audio/audio_api.h
[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/extensions/browser/api/audio/audio_service.cc
[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/extensions/browser/api/audio/audio_service.h
[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/extensions/browser/api/audio/audio_service_chromeos.cc
[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/extensions/browser/extension_function_histogram_value.h
[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/extensions/common/api/audio.idl
[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/extensions/test/data/api_test/audio/input_mute_change/background.js
[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/extensions/test/data/api_test/audio/output_mute_change/background.js
[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/extensions/test/data/api_test/audio/test.js
[modify] https://crrev.com/7cb7db5ae23a21d9267ce2e707a7eb6a1389e66e/tools/metrics/histograms/histograms.xml

Labels: -M-57 M-58
Status: Fixed (was: Started)

Comment 3 by st...@chromium.org, Mar 3 2017

Cc: r...@chromium.org

Comment 4 by st...@chromium.org, Mar 3 2017

Cc: -st...@chromium.org

Comment 5 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment