1 /* $Id: isdn_audio.h,v 1.9 2000/05/11 22:29:20 kai Exp $
2
3 * Linux ISDN subsystem, audio conversion and compression (linklevel).
4 *
5 * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 *
21 */
22
23 #define DTMF_NPOINTS 205 /* Number of samples for DTMF recognition */
24 typedef struct adpcm_state {
25 int a;
26 int d;
27 int word;
28 int nleft;
29 int nbits;
30 } adpcm_state;
31
32 typedef struct dtmf_state {
33 char last;
34 int idx;
35 int buf[DTMF_NPOINTS];
36 } dtmf_state;
37
38 typedef struct silence_state {
39 int state;
40 unsigned int idx;
41 } silence_state;
42
43 extern void isdn_audio_ulaw2alaw(unsigned char *, unsigned long);
44 extern void isdn_audio_alaw2ulaw(unsigned char *, unsigned long);
45 extern adpcm_state *isdn_audio_adpcm_init(adpcm_state *, int);
46 extern int isdn_audio_adpcm2xlaw(adpcm_state *, int, unsigned char *, unsigned char *, int);
47 extern int isdn_audio_xlaw2adpcm(adpcm_state *, int, unsigned char *, unsigned char *, int);
48 extern int isdn_audio_2adpcm_flush(adpcm_state * s, unsigned char *out);
49 extern void isdn_audio_calc_dtmf(modem_info *, unsigned char *, int, int);
50 extern void isdn_audio_eval_dtmf(modem_info *);
51 dtmf_state *isdn_audio_dtmf_init(dtmf_state *);
52 extern void isdn_audio_calc_silence(modem_info *, unsigned char *, int, int);
53 extern void isdn_audio_eval_silence(modem_info *);
54 silence_state *isdn_audio_silence_init(silence_state *);
55 extern void isdn_audio_put_dle_code(modem_info *, u_char);
56
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.