Currently, chrome.audio.setActiveDevices has overly-complex semantics, which makes it harder to use than it should be.
Main problem is that the method takes single list that contains both input and output devices. Additionally, the method does not change set of active devices of a device type if the list passed as the argument contains no devices of that device type.
This makes it impossible to disable all input or output devices.
Simpler solution would be for setActiveDevices to take two lists - one for input devices and the other for output devices. Not affecting set of active devices of a particular type could be achieved by not setting the list for that type - passing empty list would deactivate all active devices of the associated type.
Note that to preserve backward compatibility with current, whitelisted users of the API, new method for setting active devices should be named differently.
Comment 1 by bugdroid1@chromium.org
, Jan 17 2017