Skip to content

Accepted sample rates for AudioContext are underspecified #2649

@bendmorris

Description

@bendmorris

AudioContext.sampleRate mentions:

The supported values are the same as the sample rates for an AudioBuffer.

Elsewhere, createBuffer says:

An implementation MUST support sample rates in at least the range 8000 to 96000.

MUST suggests that this range is the minimum set of supported sample rates, but outside of this range the behavior is undefined. A possible interpretation is that an implementation is free to support any valid sample rate. It's also possible that OfflineAudioContext and AudioContext could have different behavior since AudioContext's sample rate is a hint and OfflineAudioContext's is a requirement.

The WPT tests of AudioContextOptions are more strict. They assert that a sampleRate of 1 or 1000000 should be rejected with a NotSupportedError.

The spec could probably clarify the status of sample rates outside of this range.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DiscussionThe issue needs more discussion before it can be fixed.category: enhancementSubstantive changes that do not add new features. https://www.w3.org/policies/process/#class-3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions