Mercurial > hg > audiostuff
comparison spandsp-0.0.6pre17/src/spandsp/super_tone_tx.h @ 4:26cd8f1ef0b1
import spandsp-0.0.6pre17
author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
---|---|
date | Fri, 25 Jun 2010 15:50:58 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:c6c5a16ce2f2 | 4:26cd8f1ef0b1 |
---|---|
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 * $Id: super_tone_tx.h,v 1.17 2009/02/10 13:06:47 steveu Exp $ | |
26 */ | |
27 | |
28 #if !defined(_SPANDSP_SUPER_TONE_TX_H_) | |
29 #define _SPANDSP_SUPER_TONE_TX_H_ | |
30 | |
31 /*! \page super_tone_tx_page Supervisory tone generation | |
32 | |
33 \section super_tone_tx_page_sec_1 What does it do? | |
34 | |
35 The supervisory tone generator may be configured to generate most of the world's | |
36 telephone supervisory tones - things like ringback, busy, number unobtainable, | |
37 and so on. It uses tree structure tone descriptions, which can deal with quite | |
38 complex cadence patterns. | |
39 | |
40 \section super_tone_tx_page_sec_2 How does it work? | |
41 | |
42 */ | |
43 | |
44 typedef struct super_tone_tx_step_s super_tone_tx_step_t; | |
45 | |
46 typedef struct super_tone_tx_state_s super_tone_tx_state_t; | |
47 | |
48 #if defined(__cplusplus) | |
49 extern "C" | |
50 { | |
51 #endif | |
52 | |
53 SPAN_DECLARE(super_tone_tx_step_t *) super_tone_tx_make_step(super_tone_tx_step_t *s, | |
54 float f1, | |
55 float l1, | |
56 float f2, | |
57 float l2, | |
58 int length, | |
59 int cycles); | |
60 | |
61 SPAN_DECLARE(int) super_tone_tx_free_tone(super_tone_tx_step_t *s); | |
62 | |
63 /*! Initialise a supervisory tone generator. | |
64 \brief Initialise a supervisory tone generator. | |
65 \param s The supervisory tone generator context. | |
66 \param tree The supervisory tone tree to be generated. | |
67 \return The supervisory tone generator context. */ | |
68 SPAN_DECLARE(super_tone_tx_state_t *) super_tone_tx_init(super_tone_tx_state_t *s, super_tone_tx_step_t *tree); | |
69 | |
70 SPAN_DECLARE(int) super_tone_tx_release(super_tone_tx_state_t *s); | |
71 | |
72 SPAN_DECLARE(int) super_tone_tx_free(super_tone_tx_state_t *s); | |
73 | |
74 /*! Generate a block of audio samples for a supervisory tone pattern. | |
75 \brief Generate a block of audio samples for a supervisory tone pattern. | |
76 \param s The supervisory tone context. | |
77 \param amp The audio sample buffer. | |
78 \param max_samples The maximum number of samples to be generated. | |
79 \return The number of samples generated. */ | |
80 SPAN_DECLARE(int) super_tone_tx(super_tone_tx_state_t *s, int16_t amp[], int max_samples); | |
81 | |
82 #if defined(__cplusplus) | |
83 } | |
84 #endif | |
85 | |
86 #endif | |
87 /*- End of file ------------------------------------------------------------*/ |