|
132 | 132 | dictionary OpusEncoderConfig {
|
133 | 133 | OpusBitstreamFormat format = "opus";
|
134 | 134 | [EnforceRange] unsigned long frameDuration;
|
| 135 | + [EnforceRange] unsigned long complexity; |
| 136 | + [EnforceRange] unsigned long packetlossperc = 0; |
| 137 | + boolean useinbandfec = false; |
| 138 | + boolean usedtx = false; |
135 | 139 | };
|
136 | 140 | </xmp>
|
137 | 141 | </pre>
|
138 | 142 |
|
139 | 143 | To check if an {{OpusEncoderConfig}} is valid, run these steps:
|
140 | 144 | 1. If {{OpusEncoderConfig/frameDuration}} is not a valid `ptime` value,
|
141 | 145 | which is described in Section 6.1 of [[RFC7587]], return `false`.
|
| 146 | +1. If {{OpusEncoderConfig/complexity}} is specified and not within the range of |
| 147 | + `0` and `10` inclusively, return `false`. |
| 148 | +1. If {{OpusEncoderConfig/packetlossperc}} is specified and not within the range of |
| 149 | + `0` and `100` inclusively, return `false`. |
142 | 150 | 2. Return `true`.
|
143 | 151 |
|
144 | 152 | <dl>
|
|
151 | 159 | <dd>
|
152 | 160 | Configures the frame duration, in milliseconds, of output {{EncodedAudioChunk}}s.
|
153 | 161 | </dd>
|
| 162 | + <dt><dfn dict-member for=OpusEncoderConfig>complexity</dfn></dt> |
| 163 | + <dd> |
| 164 | + Configures the encoder's computational complexity, as described in section 2.1.9. |
| 165 | + of [[RFC6716]]. The valid range is `0` to `10`, with `10` representing the highest |
| 166 | + complexity. If no value is specificied, the default value is platform-specific: |
| 167 | + User Agents <em class="rfc2119">SHOULD</em> set a default of `5` for mobile |
| 168 | + platforms, and a default of `9` for all other platforms. |
| 169 | + </dd> |
| 170 | + <dt><dfn dict-member for=OpusEncoderConfig>packetlossperc</dfn></dt> |
| 171 | + <dd> |
| 172 | + Configures the encoder's expected packet loss percentage. The valid range is |
| 173 | + `0` to `100`. |
| 174 | + |
| 175 | + NOTE: The packet loss percentage might be updated over the course of an |
| 176 | + encoding, and it is recommended for User Agents to support these reconfigurations. |
| 177 | + </dd> |
| 178 | + <dt><dfn dict-member for=OpusEncoderConfig>useinbandfec</dfn></dt> |
| 179 | + <dd> |
| 180 | + Specifies whether the encoder provides Opus in-band Forward Error Correction |
| 181 | + (FEC), as described by section 2.1.7. of [[RFC6716]]. |
| 182 | + </dd> |
| 183 | + <dt><dfn dict-member for=OpusEncoderConfig>usedtx</dfn></dt> |
| 184 | + <dd> |
| 185 | + Specifies if the encoder uses Discontinuous Transmission (DTX), as described |
| 186 | + by section 2.1.9. of [[RFC6716]]. |
| 187 | + </dd> |
154 | 188 | </dl>
|
155 | 189 |
|
156 | 190 | OpusBitstreamFormat {#opus-bitstream-format}
|
|
0 commit comments