libspandsp 0.0.4

time_scale.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <fcntl.h>
#include <time.h>
#include <limits.h>
#include "spandsp/telephony.h"
#include "spandsp/time_scale.h"

Functions

int time_scale_rate (time_scale_state_t *s, float rate)
 Change the time scale rate.
time_scale_state_ttime_scale_init (time_scale_state_t *s, float rate)
 Initialise a time scale context.
int time_scale_free (time_scale_state_t *s)
 Free a time scale context.
int time_scale (time_scale_state_t *s, int16_t out[], int16_t in[], int len)
 Time scale a chunk of audio samples.

Detailed Description


Function Documentation

int time_scale ( time_scale_state_t s,
int16_t  out[],
int16_t  in[],
int  len 
)

Time scale a chunk of audio samples.

Time scale a chunk of audio samples.

Parameters:
sThe time sclae context.
outThe output audio sample buffer.
inThe input audio sample buffer.
lenThe number of input samples.
Returns:
The number of output samples.
int time_scale_free ( time_scale_state_t s)

Free a time scale context.

Parameters:
sThe time scale context.
Returns:
0 for OK, else -1.
time_scale_state_t* time_scale_init ( time_scale_state_t s,
float  rate 
)

Initialise a time scale context.

Initialise a time scale context. This must be called before the first use of the context, to initialise its contents.

Parameters:
sThe time scale context.
rateThe ratio between the output speed and the input speed.
Returns:
A pointer to the context, or NULL if there was a problem.

References time_scale_rate().

int time_scale_rate ( time_scale_state_t s,
float  rate 
)

Change the time scale rate.

Change the time scale rate.

Parameters:
sThe time scale context.
rateThe ratio between the output speed and the input speed.
Returns:
0 if changed OK, else -1.

Referenced by time_scale_init().