Description
First, the spec currently does not explain the default behavior of automatic fallback upon device change or failure. For example, if the system default audio device changes, the AudioContext doesn't do anything actively. It simply follows whatever the platform offers.
This is how the conventional AudioContext works:
const context = new AudioContext();
However, the spec now provides a new way of selecting an output device via the context constructor, and also there's a way to specify the system default audio device. (""
)
const context = new AudioContext({sinkId: ""});
While we were experimenting with this feature in Chromium, we thought it would be beneficial to developers to distinguish two different cases.
For the former, it should be completely backward compatible and the context will try to follow whatever the output device provided by the platform. On the other hand, the latter expresses the developer's intent to use the default audio device "specifically", thus it should follow the device selection logic as written on the spec. It means that if the current selected audio device changes, the context will be suspended and onerror
will be dispatched.