sig_tone.h File Reference

Go to the source code of this file.

Typedefs

typedef int(* sig_tone_func_t )(void *user_data, int what)
typedef struct
sig_tone_descriptor_s 
sig_tone_descriptor_t
typedef struct sig_tone_tx_state_s sig_tone_tx_state_t
typedef struct sig_tone_rx_state_s sig_tone_rx_state_t

Enumerations

enum  { SIG_TONE_2280HZ = 1, SIG_TONE_2600HZ, SIG_TONE_2400HZ_2600HZ }
enum  {
  SIG_TONE_1_PRESENT = 0x001, SIG_TONE_1_CHANGE = 0x002, SIG_TONE_2_PRESENT = 0x004, SIG_TONE_2_CHANGE = 0x008,
  SIG_TONE_TX_PASSTHROUGH = 0x010, SIG_TONE_RX_PASSTHROUGH = 0x020, SIG_TONE_UPDATE_REQUEST = 0x100
}

Functions

int sig_tone_rx (sig_tone_rx_state_t *s, int16_t amp[], int len)
 Process a block of received audio samples.
sig_tone_rx_state_tsig_tone_rx_init (sig_tone_rx_state_t *s, int tone_type, sig_tone_func_t sig_update, void *user_data)
 Initialise a signaling tone context.
int sig_tone_rx_release (sig_tone_rx_state_t *s)
 Release a signaling tone receiver context.
int sig_tone_rx_free (sig_tone_rx_state_t *s)
 Free a signaling tone receiver context.
int sig_tone_tx (sig_tone_tx_state_t *s, int16_t amp[], int len)
 Generate a block of signaling tone audio samples.
void sig_tone_tx_set_mode (sig_tone_tx_state_t *s, int mode)
 Set the tone mode.
sig_tone_tx_state_tsig_tone_tx_init (sig_tone_tx_state_t *s, int tone_type, sig_tone_func_t sig_update, void *user_data)
 Initialise a signaling tone context.
int sig_tone_tx_release (sig_tone_tx_state_t *s)
 Release a signaling tone transmitter context.
int sig_tone_tx_free (sig_tone_tx_state_t *s)
 Free a signaling tone transmitter context.


Detailed Description


Typedef Documentation

Signaling tone descriptor. This defines the working state for a single instance of the transmit and receive sides of a signaling tone processor.


Enumeration Type Documentation

anonymous enum

Enumerator:
SIG_TONE_2280HZ  European 2280Hz signaling tone
SIG_TONE_2600HZ  US 2600Hz signaling tone
SIG_TONE_2400HZ_2600HZ  US 2400Hz + 2600Hz signaling tones

anonymous enum

Enumerator:
SIG_TONE_1_PRESENT  Signaling tone 1 is present
SIG_TONE_2_PRESENT  Signaling tone 2 is present
SIG_TONE_TX_PASSTHROUGH  The media signal is passing through. Tones might be added to it.
SIG_TONE_RX_PASSTHROUGH  The media signal is passing through. Tones might be extracted from it, if detected.


Function Documentation

int sig_tone_rx ( sig_tone_rx_state_t s,
int16_t  amp[],
int  len 
)

Process a block of received audio samples.

Process a block of received audio samples.

Parameters:
s The signaling tone context.
amp The audio sample buffer.
len The number of samples in the buffer.
Returns:
The number of samples unprocessed.

References SIG_TONE_1_PRESENT, and SIG_TONE_RX_PASSTHROUGH.

int sig_tone_rx_free ( sig_tone_rx_state_t s  ) 

Free a signaling tone receiver context.

Free a signaling tone receiver context.

Parameters:
s The signaling tone context.
Returns:
0 for OK

sig_tone_rx_state_t* sig_tone_rx_init ( sig_tone_rx_state_t s,
int  tone_type,
sig_tone_func_t  sig_update,
void *  user_data 
)

Initialise a signaling tone context.

Initialise a signaling tone receiver context.

Parameters:
s The signaling tone context.
tone_type The type of signaling tone.
sig_update Callback function to handle signaling updates.
user_data An opaque pointer.
Returns:
A pointer to the signalling tone context, or NULL if there was a problem.

int sig_tone_rx_release ( sig_tone_rx_state_t s  ) 

Release a signaling tone receiver context.

Release a signaling tone receiver context.

Parameters:
s The signaling tone context.
Returns:
0 for OK

int sig_tone_tx ( sig_tone_tx_state_t s,
int16_t  amp[],
int  len 
)

Generate a block of signaling tone audio samples.

Generate a block of signaling tone audio samples.

Parameters:
s The signaling tone context.
amp The audio sample buffer.
len The number of samples to be generated.
Returns:
The number of samples actually generated.

References dds_mod(), SIG_TONE_1_PRESENT, SIG_TONE_2_PRESENT, and SIG_TONE_TX_PASSTHROUGH.

int sig_tone_tx_free ( sig_tone_tx_state_t s  ) 

Free a signaling tone transmitter context.

Free a signaling tone transmitter context.

Parameters:
s The signaling tone context.
Returns:
0 for OK

sig_tone_tx_state_t* sig_tone_tx_init ( sig_tone_tx_state_t s,
int  tone_type,
sig_tone_func_t  sig_update,
void *  user_data 
)

Initialise a signaling tone context.

Initialise a signaling tone transmitter context.

Parameters:
s The signaling tone context.
tone_type The type of signaling tone.
sig_update Callback function to handle signaling updates.
user_data An opaque pointer.
Returns:
A pointer to the signalling tone context, or NULL if there was a problem.

References dds_phase_rate(), and dds_scaling_dbm0().

int sig_tone_tx_release ( sig_tone_tx_state_t s  ) 

Release a signaling tone transmitter context.

Release a signaling tone transmitter context.

Parameters:
s The signaling tone context.
Returns:
0 for OK

void sig_tone_tx_set_mode ( sig_tone_tx_state_t s,
int  mode 
)

Set the tone mode.

Set the tone mode.

Parameters:
s The signaling tone context.
mode The new mode for the transmitted tones.

References SIG_TONE_1_PRESENT.


Generated on Tue Aug 4 03:36:20 2009 for spandsp by  doxygen 1.5.9