Go to the source code of this file.
Classes | |
| struct | dtmf_tx_state_t |
| struct | dtmf_rx_state_t |
Defines | |
| #define | _SPANDSP_DTMF_H_ |
| #define | MAX_DTMF_DIGITS 128 |
Typedefs | |
| typedef void(*) | dtmf_rx_callback_t (void *user_data, const char *digits, int len) |
Functions | |
| int | dtmf_tx (dtmf_tx_state_t *s, int16_t amp[], int max_samples) |
| Generate a buffer of DTMF tones. | |
| size_t | dtmf_tx_put (dtmf_tx_state_t *s, const char *digits, ssize_t len) |
| Put a string of digits in a DTMF generator's input buffer. | |
| dtmf_tx_state_t * | dtmf_tx_init (dtmf_tx_state_t *s) |
| Initialise a DTMF tone generator context. | |
| void | dtmf_rx_set_realtime_callback (dtmf_rx_state_t *s, tone_report_func_t callback, void *user_data) |
| Set a realtime callback for a DTMF receiver context. | |
| void | dtmf_rx_parms (dtmf_rx_state_t *s, int filter_dialtone, int twist, int reverse_twist) |
| Adjust a DTMF receiver context. | |
| int | dtmf_rx (dtmf_rx_state_t *s, const int16_t amp[], int samples) |
| Process a block of received DTMF audio samples. | |
| int | dtmf_rx_status (dtmf_rx_state_t *s) |
| Get the status of DTMF detection during processing of the last audio chunk. | |
| size_t | dtmf_rx_get (dtmf_rx_state_t *s, char *digits, int max) |
| Get a string of digits from a DTMF receiver's output buffer. | |
| dtmf_rx_state_t * | dtmf_rx_init (dtmf_rx_state_t *s, dtmf_rx_callback_t callback, void *user_data) |
| Initialise a DTMF receiver context. | |
| int dtmf_rx | ( | dtmf_rx_state_t * | s, | |
| const int16_t | amp[], | |||
| int | samples | |||
| ) |
Process a block of received DTMF audio samples.
Process a block of received DTMF audio samples.
| s | The DTMF receiver context. | |
| amp | The audio sample buffer. | |
| samples | The number of samples in the buffer. |
| size_t dtmf_rx_get | ( | dtmf_rx_state_t * | s, | |
| char * | digits, | |||
| int | max | |||
| ) |
Get a string of digits from a DTMF receiver's output buffer.
| s | The DTMF receiver context. | |
| digits | The buffer for the received digits. | |
| max | The maximum number of digits to be returned, |
| dtmf_rx_state_t* dtmf_rx_init | ( | dtmf_rx_state_t * | s, | |
| dtmf_rx_callback_t | callback, | |||
| void * | user_data | |||
| ) |
Initialise a DTMF receiver context.
| s | The DTMF receiver context. | |
| callback | An optional callback routine, used to report received digits. If no callback routine is set, digits may be collected, using the dtmf_rx_get() function. | |
| user_data | An opaque pointer which is associated with the context, and supplied in callbacks. |
| void dtmf_rx_parms | ( | dtmf_rx_state_t * | s, | |
| int | filter_dialtone, | |||
| int | twist, | |||
| int | reverse_twist | |||
| ) |
Adjust a DTMF receiver context.
| s | The DTMF receiver context. | |
| filter_dialtone | TRUE to enable filtering of dialtone, FALSE to disable, < 0 to leave unchanged. | |
| twist | Acceptable twist, in dB. < 0 to leave unchanged. | |
| reverse_twist | Acceptable reverse twist, in dB. < 0 to leave unchanged. |
| void dtmf_rx_set_realtime_callback | ( | dtmf_rx_state_t * | s, | |
| tone_report_func_t | callback, | |||
| void * | user_data | |||
| ) |
Set a realtime callback for a DTMF receiver context.
Set a optional realtime callback for a DTMF receiver context. This function is called immediately a confirmed state change occurs in the received DTMF. It is called with the ASCII value for a DTMF tone pair, or zero to indicate no tone is being received.
| s | The DTMF receiver context. | |
| callback | Callback routine used to report the start and end of digits. | |
| user_data | An opaque pointer which is associated with the context, and supplied in callbacks. |
| int dtmf_rx_status | ( | dtmf_rx_state_t * | s | ) |
Get the status of DTMF detection during processing of the last audio chunk.
Get the status of DTMF detection during processing of the last audio chunk.
| s | The DTMF receiver context. |
| int dtmf_tx | ( | dtmf_tx_state_t * | s, | |
| int16_t | amp[], | |||
| int | max_samples | |||
| ) |
Generate a buffer of DTMF tones.
| s | The DTMF generator context. | |
| amp | The buffer for the generated signal. | |
| max_samples | The required number of generated samples. |
| dtmf_tx_state_t* dtmf_tx_init | ( | dtmf_tx_state_t * | s | ) |
Initialise a DTMF tone generator context.
| s | The DTMF generator context. |
| size_t dtmf_tx_put | ( | dtmf_tx_state_t * | s, | |
| const char * | digits, | |||
| ssize_t | len | |||
| ) |
Put a string of digits in a DTMF generator's input buffer.
| s | The DTMF generator context. | |
| digits | The string of digits to be added. | |
| len | The length of the string of digits. If negative, the string is assumed to be a NULL terminated string. |
1.5.2