Skip to content

Commit eab6c4d

Browse files
Merge pull request #551 from bdrtc/371-add-frameduration-to-opus-encoder-config
Add frameDuration attribute to OpusEncoderConfig
2 parents 5c88ee5 + 67cc867 commit eab6c4d

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

index.src.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2073,7 +2073,10 @@
20732073
run these steps:
20742074
1. If {{AudioEncoderConfig/codec}} is not a <a>valid codec string</a>, return
20752075
`false`.
2076-
2. Return `true`.
2076+
2. If the {{AudioEncoderConfig}} has a codec-specific extension and the corresponding
2077+
registration in the [[WEBCODECS-CODEC-REGISTRY]] defines steps to check whether the
2078+
the extension is a valid extension, return the result of running those steps.
2079+
3. Return `true`.
20772080

20782081
<dl>
20792082
<dt><dfn dict-member for=AudioEncoderConfig>codec</dfn></dt>

opus_codec_registration.src.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
NOTE: Once the initialization has succeeded, any packet can be decoded at any
106106
time without error, but this might not result in the expected audio output.
107107

108-
AudiEncoderConfig extensions {#audioencoderconfig-extensions}
108+
AudioEncoderConfig extensions {#audioencoderconfig-extensions}
109109
=============================================================
110110

111111
<pre class='idl'>
@@ -131,16 +131,26 @@
131131
<xmp>
132132
dictionary OpusEncoderConfig {
133133
OpusBitstreamFormat format = "opus";
134+
[EnforceRange] unsigned long frameDuration;
134135
};
135136
</xmp>
136137
</pre>
137138

139+
To check if an {{OpusEncoderConfig}} is valid, run these steps:
140+
1. If {{OpusEncoderConfig/frameDuration}} is not a valid `ptime` value,
141+
which is described in Section 6.1 of [[RFC7587]], return `false`.
142+
2. Return `true`.
143+
138144
<dl>
139145
<dt><dfn dict-member for=OpusEncoderConfig>format</dfn></dt>
140146
<dd>
141147
Configures the format of output {{EncodedAudioChunk}}s. See
142148
{{OpusBitstreamFormat}}.
143149
</dd>
150+
<dt><dfn dict-member for=OpusEncoderConfig>frameDuration</dfn></dt>
151+
<dd>
152+
Configures the frame duration, in milliseconds, of output {{EncodedAudioChunk}}s.
153+
</dd>
144154
</dl>
145155

146156
OpusBitstreamFormat {#opus-bitstream-format}

0 commit comments

Comments
 (0)