Prosody RTP processing: API: sm_vmptx_config_codec_opus_mode
Prototype Definition
int sm_vmptx_config_codec_opus_mode(struct sm_vmptx_config_codec_opus_mode_parms *codecp)
Parameters
- *codecp
-
a structure of the following type:
typedef struct sm_vmptx_config_codec_opus_mode_parms {
tSMVMPtxId vmptx; /* in */
tSM_INT sample_rate; /* in */
tSM_INT bit_rate; /* in */
tSM_INT ptime; /* in */
tSM_INT packet_loss; /* in */
tSM_INT complexity; /* in */
tSM_INT use_fec; /* in */
tSM_INT use_dtx; /* in */
enum kSMOPUSRate rate_control; /* in */
enum kSMOPUSSignalTypeHint signal_type_hint; /* in */
enum kSMOPUSAppType application_type; /* in */
tSM_INT disable_prediction; /* in */
} SM_VMPTX_CONFIG_CODEC_OPUS_MODE_PARMS;
Description
Modifies the configuration of the Opus codec.
Fields
- vmptx
- The VMP[tx] for which to change the codec parameters.
- sample_rate
- Sample rate of the audio being encoded. This must be the same as that
previously specified when
sm_vmptx_config_codec_opus()
was called to configure the VMP[tx].
- bit_rate
- The target bit rate which the codec should aim to produce. A value of zero
indicates automatic rate selection. A negative value indicates maximum possible
rate should be used. Otherwise a value in range 500 to 512000 should be specified.
For most applications automatic rate selection would be used unless peer indicates otherwise.
- ptime
- The duration in milliseconds of audio conveyed in each frame. This should be set to
a value of 10, 20, 40, or 60. Normally should be set to 20.
- packet_loss
- An estimate of the current level of packet loss to which the encoded
data will be subjected, as a percentage. Normally set to zero.
- complexity
- The complexity of the algorithms used to encode the data: 0..10
This controls the trade-off between channel count and audio quality.
0 will give the biggest channel count; 10 will give best quality.
- use_fec
- Set to any non-zero value to include data for "forward error correction"
(FEC) in the transmitted stream. Only recommended if really needed, as it
reduces quality unless there is significant packet loss.
- use_dtx
- Set to any non-zero value to suppress transmission of data during silence.
Not recommended unless average bit rate is absolutely critical.
- rate_control
- Control variation of encoded bit rate.
One of these values:
- kSMOPUSRateConstrainedVariable
- Constrained variable rate.
- kSMOPUSRateUnconstrainedVariable
- Unconstrained variable rate.
- kSMOPUSRateConstant
- Constant bit rate.
- signal_type_hint
- Provides hint about nature of signal being encoded.
One of these values:
- kSMOPUSSignalTypeHintNone
- Nature of signal not known.
- kSMOPUSSignalTypeHintVoice
- Signal to be encoded is voice.
- kSMOPUSSignalTypeHintMusic
- Signal to be encoded is music.
- application_type
- Provides hint about application type.
One of these values:
- kSMOPUSAppTypeVoIP
- Process signal for improved speech intelligibility.
- kSMOPUSAppTypeAudio
- Favour faithfulness to the original input..
- kSMOPUSAppTypeLowDelay
- Configure the minimum possible coding delay by disabling certain modes of operation.
- disable_prediction
- Set to zero for default behaviour, set to 1 to disable almost all use of prediction, making frames almost completely independent.
Returns
0
if call completed successfully, otherwise a standard error such as:
- ERR_SM_DEVERR - device error
This function is part of the Prosody RTP processing API.