Skip to content

[ WebCodecs | AudioDecoder ] Test wants both the same configuration to be invalid and not supported: it can only be one or the other. #49636

Open
@jyavenard

Description

In

comment: 'Opus with >2 channels but no description',
config: {
codec: 'opus',
sampleRate: 48000,
numberOfChannels: 6,
}

It checks that a configuration using Opus with more than 2 channels and no description be considered invalid.

But in:

comment: 'Opus with more than two channels and without description',
config: {
codec: 'opus',
sampleRate: '48000',
numberOfChannels: 3,
},
},
{
comment: 'Opus with more than two channels and with a description that is too short',
config: {
codec: 'opus',
sampleRate: '48000',
numberOfChannels: 3,
description: new Uint8Array(9), // at least 10 bytes are required for multichannel

It checks that a configuration using Opus with more than 2 channels and no description is not supported.

It can't be both.

Per spec https://w3c.github.io/webcodecs/#dom-audiodecoder-configure
"If config is not a valid AudioDecoderConfig, throw a TypeError."

So if we want a configuration using Opus with more than 2 channels and no description be considered as invalid, then configure
must throw with a TypeError when given that same configuration.

In the same line of thought,it would probably make sense to also check the Opus' description is greater than 10 bytes and make it be invalid otherwise.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions