Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numberOfChannels/sampleRate check in AudioDecoderConfig/AudioEncoderConfig #791

Open
chrisguttandin opened this issue May 22, 2024 · 1 comment

Comments

@chrisguttandin
Copy link
Contributor

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: #780.

@padenot
Copy link
Collaborator

padenot commented May 22, 2024

Yeah, we talked about harmonizing implem and tests in an issue not too long ago, but I can't find it.

For decoding, it's not 100% required to provide the sample-rate and the channel count, sometimes it's possible to determine them from the bit stream. Sometimes it is required though.

For encoding, it's always required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants