Sample rate conversion algorithm.
More...
This section describes the base resampling functions. In addition to this, application can use the Resample Port which provides media port abstraction for the base resampling algorithm.
◆ pjmedia_resample
◆ pjmedia_resample_create()
Create a frame based resample session.
- Parameters
-
pool | Pool to allocate the structure and buffers. |
high_quality | If true, then high quality conversion will be used, at the expense of more CPU and memory, because temporary buffer needs to be created. |
large_filter | If true, large filter size will be used. |
channel_count | Number of channels. |
rate_in | Clock rate of the input samples. |
rate_out | Clock rate of the output samples. |
samples_per_frame | Number of samples per frame in the input. |
p_resample | Pointer to receive the resample session. |
- Returns
- PJ_SUCCESS on success.
◆ pjmedia_resample_run()
Use the resample session to resample a frame. The frame must have the same size and settings as the resample session, or otherwise the behavior is undefined.
- Parameters
-
resample | The resample session. |
input | Buffer containing the input samples. |
output | Buffer to store the output samples. |
◆ pjmedia_resample_get_input_size()
Get the input frame size of a resample session.
- Parameters
-
resample | The resample session. |
- Returns
- The frame size, in number of samples.
◆ pjmedia_resample_destroy()
Destroy the resample.
- Parameters
-
resample | The resample session. |