OPUS_EXPORT void opus_encoder_destroy(OpusEncoder *st);
/** Perform a CTL function on an Opus encoder.
+ *
+ * Generally the request and subsequent arguments are generated
+ * by a convenience macro.
* @see encoderctls
*/
OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...);
);
/** Perform a CTL function on an Opus decoder.
- * @see decoderctls
+ *
+ * Generally the request and subsequent arguments are generated
+ * by a convenience macro.
+ * @see genericctls
*/
OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...);
*/
OPUS_EXPORT int opus_packet_get_nb_channels(const unsigned char *data);
-/** Gets the number of frame in an Opus packet.
+/** Gets the number of frames in an Opus packet.
* @param [in] packet <tt>char*</tt>: Opus packet
* @param [in] len <tt>int</tt>: Length of packet
* @returns Number of frames
/** @endcond */
/** @defgroup ctlvalues Pre-defined values for CTL interface
- * @see genericctls,encoderctls
+ * @see genericctls, encoderctls
* @{
*/
/* Values for the various encoder CTLs */
/** @defgroup encoderctls Encoder related CTLs
- * @see genericctls,opusencoder
+ *
+ * These are convenience macros for use with the \c opus_encode_ctl
+ * interface. They are used to generate the appropriate series of
+ * arguments for that call, passing the correct type, size and so
+ * on as expected for each particular request.
+ *
+ * Some usage examples:
+ *
+ * @code
+ * int ret;
+ * ret = opus_encoder_ctl(enc_ctx, OPUS_SET_BANDWIDTH(OPUS_AUTO));
+ * if (ret != OPUS_OK) return ret;
+ *
+ * int rate;
+ * opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&rate));
+ *
+ * opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE);
+ * @endcode
+ *
+ * @see genericctls, opusencoder
* @{
*/
* The supported values are:
* - OPUS_APPLICATION_VOIP Process signal for improved speech intelligibility
* - OPUS_APPLICATION_AUDIO Favor faithfulness to the original input
+ * - OPUS_APPLICATION_RESTRICTED_LOWDELAY Configure the minimum possible coding delay
+ *
* @param[in] x <tt>int</tt>: Application value
* @hideinitializer */
#define OPUS_SET_APPLICATION(x) OPUS_SET_APPLICATION_REQUEST, __opus_check_int(x)
/**@}*/
/** @defgroup genericctls Generic CTLs
- * @see opus_encoder_ctl,opusencoder,opusdecoder
+ *
+ * These macros are used with the \c opus_decoder_ctl and
+ * \c opus_encoder_ctl calls to generate a particular
+ * request.
+ *
+ * When called on an \c OpusDecoder they apply to that
+ * particular decoder instance. When called on an
+ * \c OpusEncoder they apply to the corresponding setting
+ * on that encoder instance, if present.
+ *
+ * Some usage examples:
+ *
+ * @code
+ * int ret;
+ * opus_int32 pitch;
+ * ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch));
+ * if (ret == OPUS_OK) return ret;
+ *
+ * opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE);
+ * opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE);
+ *
+ * opus_int32 enc_bw, dec_bw;
+ * opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw));
+ * opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw));
+ * if (enc_bw != dec_bw) {
+ * printf("packet bandwidth mismatch!\n");
+ * }
+ * @endcode
+ *
+ * @see opusencoder, opus_decoder_ctl, opus_encoder_ctl
* @{
*/
* e.g. time stretching/shortening. If the last frame was not voiced, or if the
* pitch was not coded in the frame, then zero is returned.
*
+ * This CTL is only implemented for decoder instances.
+ *
* @param[out] x <tt>opus_int32*</tt>: pitch period at 48 kHz (or 0 if not available)
*
* @hideinitializer */