Skip to content

Specify different behaviors for no sink ID and the default sink ID (""). #2596

Open
@hoch

Description

@hoch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs EditsDecision has been made, the issue can be fixed. https://speced.github.io/spec-maintenance/about/Priority: Eventually"nice to have". https://speced.github.io/spec-maintenance/about/category: enhancementSubstantive changes that do not add new features. https://www.w3.org/policies/process/#class-3size: SSmall amount of work expected to resolve.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions