#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include "floating_fudge.h"
#include <memory.h>
#include <string.h>
#include "spandsp/telephony.h"
#include "spandsp/dc_restore.h"
#include "spandsp/saturated.h"
#include "spandsp/complex.h"
#include "spandsp/dds.h"
#include "spandsp/sig_tone.h"
Defines | |
#define | PI 3.14159265358979323 |
Functions | |
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_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. | |
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_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. | |
Variables | |
sig_tone_descriptor_t | sig_tones [4] |
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.
s | The signaling tone context. | |
amp | The audio sample buffer. | |
len | The number of samples in the buffer. |
References SIG_TONE_1_PRESENT, and SIG_TONE_RX_PASSTHROUGH.
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.
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. |
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.
s | The signaling tone context. | |
amp | The audio sample buffer. | |
len | The number of samples to be generated. |
References dds_mod(), SIG_TONE_1_PRESENT, SIG_TONE_2_PRESENT, and SIG_TONE_TX_PASSTHROUGH.
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.
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. |
References dds_phase_rate(), and dds_scaling_dbm0().
void sig_tone_tx_set_mode | ( | sig_tone_tx_state_t * | s, | |
int | mode | |||
) |
Set the tone mode.
Set the tone mode.
s | The signaling tone context. | |
mode | The new mode for the transmitted tones. |
References SIG_TONE_1_PRESENT.