spandsp: super_tone_tx.h Source File

spandsp 0.0.6

super_tone_tx.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * super_tone_tx.h - Flexible telephony supervisory tone generation.
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2001 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 2.1,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#if !defined(_SPANDSP_SUPER_TONE_TX_H_)
27#define _SPANDSP_SUPER_TONE_TX_H_
28
29/*! \page super_tone_tx_page Supervisory tone generation
30
31\section super_tone_tx_page_sec_1 What does it do?
32
33The supervisory tone generator may be configured to generate most of the world's
34telephone supervisory tones - things like ringback, busy, number unobtainable,
35and so on. It uses tree structure tone descriptions, which can deal with quite
36complex cadence patterns.
37
38\section super_tone_tx_page_sec_2 How does it work?
39
40*/
41
42typedef struct super_tone_tx_step_s super_tone_tx_step_t;
43
44typedef struct super_tone_tx_state_s super_tone_tx_state_t;
45
46#if defined(__cplusplus)
47extern "C"
48{
49#endif
50
51SPAN_DECLARE(super_tone_tx_step_t *) super_tone_tx_make_step(super_tone_tx_step_t *s,
52 float f1,
53 float l1,
54 float f2,
55 float l2,
56 int length,
57 int cycles);
58
59SPAN_DECLARE(int) super_tone_tx_free_tone(super_tone_tx_step_t *s);
60
61/*! Initialise a supervisory tone generator.
62 \brief Initialise a supervisory tone generator.
63 \param s The supervisory tone generator context.
64 \param tree The supervisory tone tree to be generated.
65 \return The supervisory tone generator context. */
66SPAN_DECLARE(super_tone_tx_state_t *) super_tone_tx_init(super_tone_tx_state_t *s, super_tone_tx_step_t *tree);
67
68SPAN_DECLARE(int) super_tone_tx_release(super_tone_tx_state_t *s);
69
70SPAN_DECLARE(int) super_tone_tx_free(super_tone_tx_state_t *s);
71
72/*! Generate a block of audio samples for a supervisory tone pattern.
73 \brief Generate a block of audio samples for a supervisory tone pattern.
74 \param s The supervisory tone context.
75 \param amp The audio sample buffer.
76 \param max_samples The maximum number of samples to be generated.
77 \return The number of samples generated. */
78SPAN_DECLARE(int) super_tone_tx(super_tone_tx_state_t *s, int16_t amp[], int max_samples);
79
80#if defined(__cplusplus)
81}
82#endif
83
84#endif
85/*- End of file ------------------------------------------------------------*/
super_tone_tx_state_s
Definition private/super_tone_tx.h:40
super_tone_tx_step_s
Definition private/super_tone_tx.h:30