Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

dtmf.h

Go to the documentation of this file.
00001 /* 00002 * ---------------------------------------------------------------------------- 00003 * "THE BEER-WARE LICENSE" (Revision 42): 00004 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you 00005 * can do whatever you want with this stuff. If we meet some day, and you think 00006 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 00007 * ---------------------------------------------------------------------------- 00008 * 00009 * Extract DTMF signals from 16 bit PCM audio 00010 * 00011 * Originally written by Poul-Henning Kamp <phk@freebsd.org> 00012 * Made into a C++ class by Roger Hardiman <roger@freebsd.org>, January 2002 00013 * 00014 * $Log: dtmf.h,v $ 00015 * Revision 1.2 2002/09/16 01:08:59 robertj 00016 * Added #define so can select if #pragma interface/implementation is used on 00017 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00018 * 00019 * Revision 1.1 2002/01/23 11:43:26 rogerh 00020 * Add DTMF Decoder class. This can be passed PCM audio data 00021 * (at 16 bit, 8 KHz) and returns any DTMF codes detected. 00022 * Tested with NetMeeting sending DTMF over a G.711 stream. 00023 * 00024 */ 00025 00026 #ifndef _DTMF_H 00027 #define _DTMF_H 00028 00029 #ifdef P_USE_PRAGMA 00030 #pragma interface 00031 #endif 00032 00033 class PDTMFDecoder : public PObject 00034 { 00035 PCLASSINFO(PDTMFDecoder, PObject) 00036 00037 public: 00038 PDTMFDecoder(); 00039 PString Decode(const void *buf, PINDEX bytes); 00040 00041 protected: 00042 // key lookup table (initialised once) 00043 char key[256]; 00044 00045 // frequency table (initialised once) 00046 int p1[8]; 00047 00048 // variables to be retained on each cycle of the decode function 00049 int h[8], k[8], y[8]; 00050 int nn, so, ia; 00051 }; 00052 #endif /* _DTMF_H */

Generated on Sat Jul 24 15:35:56 2004 for PWLib by doxygen 1.3.7