tone_generate.h File Reference

Go to the source code of this file.

Classes

struct  tone_gen_descriptor_t
struct  tone_gen_state_t
struct  dtmf_tx_state_t
struct  cadenced_tone_t

Defines

#define _TONE_GENERATE_H_
#define MAX_DTMF_DIGITS   128

Enumerations

enum  mf_tone_types_e { BELL_MF_TONES, R2_MF_TONES, SOCOTEL_TONES }

Functions

void make_tone_descriptor (tone_gen_descriptor_t *desc, cadenced_tone_t *tone)
void make_tone_gen_descriptor (tone_gen_descriptor_t *s, int f1, int l1, int f2, int l2, int d1, int d2, int d3, int d4, int repeat)
void tone_gen_init (tone_gen_state_t *s, tone_gen_descriptor_t *t)
int tone_gen (tone_gen_state_t *s, int16_t amp[], int max_samples)
void dtmf_gen_init (void)
 Initialise DTMF tone generation. This should be called before any other use of the DTMF tone features.
dtmf_tx_state_tdtmf_tx_init (dtmf_tx_state_t *s)
 Initialise a DTMF tone generator context.
int dtmf_tx (dtmf_tx_state_t *s, int16_t amp[], int max_samples)
 Generate a buffer of DTMF tones.
int dtmf_put (dtmf_tx_state_t *s, const char *digits)
 Put a string of digits in a DTMF generator's input buffer.
void bell_mf_gen_init (void)
 Initialise Bell MF tone generation. This should be called before any other use of the Bell MF tone features.
dtmf_tx_state_tbell_mf_tx_init (dtmf_tx_state_t *s)
 Initialise a Bell MF generator context.
void r2_mf_tx_init (void)
 Initialise MFC/R2 tone generation. This should be called before any other use of the MFC/R2 tone features.
int r2_mf_tx (tone_gen_state_t *s, int16_t amp[], int samples, int fwd, char digit)
 Generate a block of R2 MF tones.


Detailed Description


Function Documentation

dtmf_tx_state_t* bell_mf_tx_init ( dtmf_tx_state_t s  ) 

Initialise a Bell MF generator context.

Parameters:
s The Bell MF generator context (same type as a DTMF context).
Returns:
A pointer to the Bell MF generator context.

int dtmf_put ( dtmf_tx_state_t s,
const char *  digits 
)

Put a string of digits in a DTMF generator's input buffer.

Parameters:
s The DTMF generator context.
digits The string of digits to be added.
Returns:
The number of digits actually added. This may be less than the length of the digit string, if the buffer fills up.

int dtmf_tx ( dtmf_tx_state_t s,
int16_t  amp[],
int  max_samples 
)

Generate a buffer of DTMF tones.

Parameters:
s The DTMF generator context.
amp The buffer for the generated signal.
max_samples The required number of generated samples.
Returns:
The number of samples actually generated. This may be less than samples if the input buffer empties.

dtmf_tx_state_t* dtmf_tx_init ( dtmf_tx_state_t s  ) 

Initialise a DTMF tone generator context.

Parameters:
s The DTMF generator context.
Returns:
A pointer to the DTMF generator context.

int r2_mf_tx ( tone_gen_state_t s,
int16_t  amp[],
int  samples,
int  fwd,
char  digit 
)

Generate a block of R2 MF tones.

Parameters:
s The R2 MF generate context.
amp The buffer for the generated signal.
samples The required number of generated samples.
fwd TRUE to use the forward tone set. FALSE to use the reverse tone set.
digit The digit to be generated. When continuing to generate the same digit as during the last call to this function, digit should be set to 0x7F.
Returns:
The number of samples actually generated.


Generated on Fri Nov 10 09:40:25 2006 for libspandsp by  doxygen 1.5.1