Prosody signal path processing: API: sm_path_resample

Prototype Definition

int sm_path_resample(struct sm_path_resample_parms *resamplep)

Parameters

*resamplep
a structure of the following type:
typedef struct sm_path_resample_parms {
	tSMPathId path;						/* in */
	tSM_INT uprate;						/* in */
	tSM_INT downrate;					/* in */
} SM_PATH_RESAMPLE_PARMS;

Description

Configures sample rate conversion on a signal path. If uprate and downrate are equal, sample rate conversion is disabled. Otherwise the signal is converted to a sampling rate of uprate / downrate times the original sampling rate. For example, if uprate is two, and downrate is one, the sampling rate is doubled. To produce the best audio quality, and to use the least processor time, uprate should always be kept as small as possible. For example, uprate = 2, with downrate = 3, would decrease the sampling rate to two-thirds of the original value, but so would uprate = 4, with downrate = 6. Both the audio quality and the CPU loading will be noticeably better with uprate = 2, than with uprate = 4.

Requires the module resample.

Fields

path
The signal path to be configured
uprate
Sets the up-sampling ratio. This value must be in the range 1..6.
downrate
Sets the down-sampling ratio. This value must be in the range 1..6.

Returns

0 if call completed successfully, otherwise a standard error.


This function is part of the Prosody signal path processing API.