isdn_audio.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* $Id: isdn_audio.h,v 1.1.2.2 2004/01/12 22:37:18 keil 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 software may be used and distributed according to the terms
  8. * of the GNU General Public License, incorporated herein by reference.
  9. *
  10. */
  11. #define DTMF_NPOINTS 205 /* Number of samples for DTMF recognition */
  12. typedef struct adpcm_state {
  13. int a;
  14. int d;
  15. int word;
  16. int nleft;
  17. int nbits;
  18. } adpcm_state;
  19. typedef struct dtmf_state {
  20. char last;
  21. char llast;
  22. int idx;
  23. int buf[DTMF_NPOINTS];
  24. } dtmf_state;
  25. typedef struct silence_state {
  26. int state;
  27. unsigned int idx;
  28. } silence_state;
  29. extern void isdn_audio_ulaw2alaw(unsigned char *, unsigned long);
  30. extern void isdn_audio_alaw2ulaw(unsigned char *, unsigned long);
  31. extern adpcm_state *isdn_audio_adpcm_init(adpcm_state *, int);
  32. extern int isdn_audio_adpcm2xlaw(adpcm_state *, int, unsigned char *, unsigned char *, int);
  33. extern int isdn_audio_xlaw2adpcm(adpcm_state *, int, unsigned char *, unsigned char *, int);
  34. extern void isdn_audio_calc_dtmf(modem_info *, unsigned char *, int, int);
  35. extern void isdn_audio_eval_dtmf(modem_info *);
  36. dtmf_state *isdn_audio_dtmf_init(dtmf_state *);
  37. extern void isdn_audio_calc_silence(modem_info *, unsigned char *, int, int);
  38. extern void isdn_audio_eval_silence(modem_info *);
  39. silence_state *isdn_audio_silence_init(silence_state *);
  40. extern void isdn_audio_put_dle_code(modem_info *, u_char);