Skip to content

Commit

Permalink
sampleRate and numberOfChannels are required and have to be non-zero …
Browse files Browse the repository at this point in the history
…in a valid AudioEncoderConfig

They are not required for decoding -- this depends on the codec.

This fixes #714.
  • Loading branch information
padenot committed Mar 15, 2024
1 parent c97f298 commit 0446a14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -2051,8 +2051,8 @@
<xmp class='idl'>
dictionary AudioEncoderConfig {
required DOMString codec;
[EnforceRange] unsigned long sampleRate;
[EnforceRange] unsigned long numberOfChannels;
[EnforceRange] required unsigned long sampleRate;
[EnforceRange] required unsigned long numberOfChannels;
[EnforceRange] unsigned long long bitrate;
BitrateMode bitrateMode = "variable";
};
Expand All @@ -2069,7 +2069,9 @@
2. If the {{AudioEncoderConfig}} has a codec-specific extension and the corresponding
registration in the [[WEBCODECS-CODEC-REGISTRY]] defines steps to check whether
the extension is a valid extension, return the result of running those steps.
3. Return `true`.
3. If {{AudioEncoderConfig/sampleRate}} or {{AudioEncoderConfig/numberOfChannels}} are
equal to zero, return `false`.
4. Return `true`.

<dl>
<dt><dfn dict-member for=AudioEncoderConfig>codec</dfn></dt>
Expand Down

0 comments on commit 0446a14

Please sign in to comment.