Skip to content

Commit b680b00

Browse files
committed
sampleRate and numberOfChannels are required and have to be non-zero in a valid AudioEncoderConfig
They are not required for decoding -- this depends on the codec. This fixes #714.
1 parent a5e076e commit b680b00

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

index.src.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,8 +2051,8 @@
20512051
<xmp class='idl'>
20522052
dictionary AudioEncoderConfig {
20532053
required DOMString codec;
2054-
[EnforceRange] unsigned long sampleRate;
2055-
[EnforceRange] unsigned long numberOfChannels;
2054+
[EnforceRange] required unsigned long sampleRate;
2055+
[EnforceRange] required unsigned long numberOfChannels;
20562056
[EnforceRange] unsigned long long bitrate;
20572057
BitrateMode bitrateMode = "variable";
20582058
};
@@ -2069,7 +2069,9 @@
20692069
2. If the {{AudioEncoderConfig}} has a codec-specific extension and the corresponding
20702070
registration in the [[WEBCODECS-CODEC-REGISTRY]] defines steps to check whether
20712071
the extension is a valid extension, return the result of running those steps.
2072-
3. Return `true`.
2072+
3. If {{AudioEncoderConfig/sampleRate}} or {{AudioEncoderConfig/numberOfChannels}} are
2073+
equal to zero, return `false`.
2074+
4. Return `true`.
20732075

20742076
<dl>
20752077
<dt><dfn dict-member for=AudioEncoderConfig>codec</dfn></dt>

0 commit comments

Comments
 (0)