w3c / w3c/webcodecs

numberOfChannels/sampleRate check in AudioDecoderConfig/AudioEncoderConfig

Open
#791 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1.3k
Forks
194
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Right now a valid AudioEncoderConfig needs to have a numberOfChannels and a sampleRate property greater than zero.

https://w3c.github.io/webcodecs/#valid-audioencoderconfig

A similar check does not exist to validate an AudioDecoderConfig.

https://w3c.github.io/webcodecs/#valid-audiodecoderconfig

Chrome seems to perform the same non-zero checks for an AudioEncoderConfig and AudioDecoderConfig. But as far as I can tell they are not covered by a WPT.

The checks for an AudioEncoderConfig were added here: https://github.com/w3c/webcodecs/pull/780.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the valid-audiodecoderconfig specification and compare it with the existing AudioEncoderConfig checks. Add WPT coverage for zero or missing numberOfChannels and sampleRate in AudioDecoderConfig, and verify that the resulting behavior matches the stated validation requirements.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.