OpenH323 1.18.0
|
00001 /* 00002 ixjDefs.h 00003 00004 Copyright (c) 1996-1998, Quicknet Technologies, Inc. 00005 All Rights Reserved. 00006 00007 Internet PhoneJACK, Internet LineJACK, etc. definitions. 00008 00009 ----------------------------------------------------------------- 00010 00011 $Header: /home/cvsroot/openh323/include/ixjDefs.h,v 1.4 2002/03/21 21:21:10 craigs Exp $ 00012 00013 $Log: ixjDefs.h,v $ 00014 Revision 1.4 2002/03/21 21:21:10 craigs 00015 Move idb stuff to separate file 00016 00017 00018 */ 00019 00020 #ifndef _IXJDEFS_H 00021 #define _IXJDEFS_H 00022 00023 #include <ixjIdb.h> 00024 00025 //========================================================================== 00026 //========================================================================== 00027 // 00028 // Constants and structures for Quicknet's Internet PhoneJACK and 00029 // Internet LineJACK cards. 00030 // 00031 //========================================================================== 00032 00033 //------------------------------------------------ 00034 // Plug and Play IDs 00035 //------------------------------------------------ 00036 #define MODEL_INTERNET_PHONEJACK 0x0100 00037 #define MODEL_INTERNET_BLACKJACK 0x0200 00038 #define MODEL_INTERNET_LINEJACK 0x0300 00039 #define MODEL_INTERNET_PHONEJACK_LITE 0x0400 00040 #define MODEL_INTERNET_PHONEJACK_PCI 0x0500 00041 #define MODEL_INTERNET_PHONEJACK_TJPCI 0x0501 00042 #define MODEL_INTERNET_PHONECARD 0x0600 00043 00044 //-------------------------------------------------------------------------- 00045 // Codec support 00046 //-------------------------------------------------------------------------- 00047 // 00048 #define CODEC_RATE_4000Hz 4000 00049 #define CODEC_RATE_5500Hz 5500 00050 #define CODEC_RATE_6000Hz 6000 00051 #define CODEC_RATE_7333Hz 7333 00052 #define CODEC_RATE_8000Hz 8000 00053 #define CODEC_RATE_11025Hz 11025 00054 #define CODEC_RATE_16000Hz 16000 00055 #define CODEC_RATE_22050Hz 22050 00056 #define CODEC_RATE_32000Hz 32000 00057 #define CODEC_RATE_33075Hz 33075 00058 #define CODEC_RATE_44100Hz 44100 00059 #define CODEC_RATE_48000Hz 48000 00060 00061 #define OLD_CODEC_RATE_4000Hz 1000 00062 #define OLD_CODEC_RATE_5500Hz 1010 00063 #define OLD_CODEC_RATE_6000Hz 1020 00064 #define OLD_CODEC_RATE_7333Hz 1030 00065 #define OLD_CODEC_RATE_8000Hz 1040 00066 #define OLD_CODEC_RATE_11025Hz 1050 00067 #define OLD_CODEC_RATE_16000Hz 1060 00068 #define OLD_CODEC_RATE_22050Hz 1070 00069 #define OLD_CODEC_RATE_32000Hz 1080 00070 #define OLD_CODEC_RATE_33075Hz 1090 00071 #define OLD_CODEC_RATE_44100Hz 1100 00072 #define OLD_CODEC_RATE_48000Hz 1110 00073 00074 // XTAL = 3.8912 MHz 00075 // Clock = 10*XTAL = 38.912 MHz 00076 // 00077 // Rules: 00078 // SCLK = Clock/(N+1) 00079 // FSYNC = SCLK/(M+1) 00080 // 00081 // 4 <= (N+1) <= 32 00082 // For 8-bit Codec: SCLK >= 16*FSYNC 00083 // For 16-bit Codec: SCLK >= 32*FSYNC 00084 // 00085 // 8Khz Playback/Record: 00086 // SCLK = Clock/( 18+1) = 2.048 MHz 00087 // FSYNC = SCLK/(255+1) = 8000 Hz ( 8,000.0 Hz = 8,000 Hz standard + 0%) 00088 // 11Khz Playback/Record: 00089 // SCLK = Clock/( 13+1) = 2.779 MHz 00090 // FSYNC = SCLK/(251+1) = 11025 Hz (11,029.5 Hz = 11,025 Hz standard + -0.04%) 00091 // 22Khz Playback/Record: 00092 // SCLK = Clock/( 9+1) = 3.8912 MHz 00093 // FSYNC = SCLK/(175+1) = 22050 Hz (22,109.1 Hz = 22,050 Hz standard + ?.?%) +59.1 00094 // 00095 // SCLK = Clock/( 13+1) = 2.779 MHz 00096 // FSYNC = SCLK/(125+1) = 22050 Hz (22,059.0 Hz = 22,050 Hz standard + ?.?%) 00097 // 00098 00099 // XTAL = 3.8912 MHz 00100 // Clock = 10*XTAL = 38.912 MHz 00101 // 00102 // SCLK = Clock/( 18+1) = 2.048 MHz 00103 // FSYNC = SCLK/(371+1) = 5505 Hz ( 5,505.4 Hz = 5,500 Hz standard + x%) 00104 // FSYNC = SCLK/(340+1) = 6006 Hz ( 6,005.9 Hz = 6,000 Hz standard + x%) 00105 // FSYNC = SCLK/(278+1) = 7341 Hz ( 7,340.5 Hz = 7,333 Hz standard + x%) 00106 // FSYNC = SCLK/(255+1) = 8000 Hz ( 8,000.0 Hz = 8,000 Hz standard + 0%) 00107 // FSYNC = SCLK/(127+1) = 16000 Hz (16,000.0 Hz = 16,000 Hz standard + 0%) 00108 // FSYNC = SCLK/( 63+1) = 32000 Hz (32,000.0 Hz = 32,000 Hz standard + 0%) 00109 // FSYNC = SCLK/( 61+1) = 33032 Hz (33,032.3 Hz = 33,075 Hz standard + x%) 00110 // FSYNC = SCLK/( 45+1) = 44522 Hz (44,521.7 Hz = 44,100 Hz standard + x%) 00111 // FSYNC = SCLK/( 42+1) = 47628 Hz (47,627.9 Hz = 48,000 Hz standard - x%) 00112 00113 // Selects: Sets the division factor used to divide the SCLK clock to generate FSYNC. 00114 #define CODEC_FSYNC_RATE_371 371 00115 #define CODEC_FSYNC_RATE_340 340 00116 #define CODEC_FSYNC_RATE_278 278 00117 #define CODEC_FSYNC_RATE_255 255 00118 #define CODEC_FSYNC_RATE_251 251 00119 #define CODEC_FSYNC_RATE_185 185 00120 #define CODEC_FSYNC_RATE_175 175 00121 #define CODEC_FSYNC_RATE_127 127 00122 #define CODEC_FSYNC_RATE_125 125 00123 #define CODEC_FSYNC_RATE_92 92 00124 #define CODEC_FSYNC_RATE_63 63 00125 #define CODEC_FSYNC_RATE_61 61 00126 #define CODEC_FSYNC_RATE_45 45 00127 #define CODEC_FSYNC_RATE_42 42 00128 00129 // Selects: Sets the division factor used to divide the main CT8020 clock to generate SCLK. 00130 #define CODEC_CO_RATE_9 9 00131 #define CODEC_CO_RATE_13 13 00132 #define CODEC_CO_RATE_19 19 00133 #define CODEC_CO_RATE_18 18 00134 00135 const WORD CODEC_WIDTH_8BIT = 0; // Selects 8-bit Mu-law codec. 00136 const WORD CODEC_WIDTH_16BIT = 1; // Selects 16-bit linear codec. 00137 00138 const WORD CODEC_LAW_MULAW = 0; // Selects external Mu-law codec. 00139 00140 const WORD CODEC_MASTER_SLAVE = 0; // Selects save mode (FSYNC and SCLK are inputs - default after reset). 00141 const WORD CODEC_MASTER_MASTER = 1; // Selects master mode (FSYNC and SCLK are outputs). 00142 00143 const WORD CODEC_LONG_SHORTFRAME = 0; // Selects short frame sync mode when WIDE=0. 00144 const WORD CODEC_LONG_LONGFRAME = 1; // Selects long frame sync mode when WIDE=1. 00145 00146 const WORD CODEC_OUTPUT_CODEC_DEFAULT = 0; // Selects: default output codec routing. 00147 const WORD CODEC_OUTPUT_CODEC_CODEC1 = 1; // Selects: output signal goes to codec 1 only. 00148 const WORD CODEC_OUTPUT_CODEC_CODEC0 = 2; // Selects: output signal goes to codec 0 only. 00149 const WORD CODEC_OUTPUT_CODEC_BOTH = 3; // Selects: output signal goes to both codec 0 and codec 1. 00150 00151 const WORD CODEC_INPUT_CODEC_NORMAL = 0; // Selects: normal input codec routing. 00152 const WORD CODEC_INPUT_CODEC_EXCHANGE = 1; // Selects: input from codec 0 and codec 1 exchanged. 00153 00154 const WORD CODEC_SET_RATE_NOACTION = 0; // Selects: no action. 00155 const WORD CODEC_SET_RATE_NEXTCMD = 1; // Selects: next command word programs codec sample rate dividers. 00156 00157 const WORD CODEC_WIDE_1SCLK = 0; // Selects: FSYNC is 1 SCLK period wide. 00158 const WORD CODEC_WIDE_8OR16SCLKS = 1; // Selects: FSYNC is 8 SCLK periods wide if Width=0 or 16 SCLK periods wide if Width=1. 00159 00160 const DWORD XTAL_38912 = 3891200; 00161 const DWORD XTAL_4000 = 4000000; 00162 const DWORD XTAL_4096 = 4096000; 00163 00164 const DWORD SCLK_2048 = 2048000; 00165 const DWORD SCLK_512 = 512000; 00166 const DWORD SCLK_1024 = 1024000; 00167 const DWORD SCLK_2000 = 2000000; 00168 const DWORD SCLK_MAX = 1835008; // 300373; // 2097152; // 2095600; 00169 00170 //========================================================================== 00171 //-------------------------------------------------------------------------- 00172 // Compression/Decompression support 00173 //-------------------------------------------------------------------------- 00174 // 00175 #define COMPRESS_MODE_TRUESPEECH 0 // Selects: TrueSpeech 8.5, 6.3, 5.3, 4.8 or 4.1 Kbps 00176 #define COMPRESS_MODE_ULAW 2 // Selects: 64 Kbit/sec U-law PCM 00177 #define COMPRESS_MODE_16LINEAR 6 // Selects: 128 Kbit/sec 16-bit linear 00178 #define COMPRESS_MODE_8LINEAR 4 // Selects: 64 Kbit/sec 8-bit signed linear 00179 #define COMPRESS_MODE_8LINEAR_WSS 5 // Selects: 64 Kbit/sec WSS 8-bit unsigned linear 00180 00181 // TrueSpeech compress modes: 8.5 - 4.1 00182 #define COMPRESS_RATE_TS85 0 // Selects TrueSpeech 8.5 play mode. 00183 #define COMPRESS_RATE_TS63 1 // Selects TrueSpeech 6.3 play mode. 00184 #define COMPRESS_RATE_TS53 2 // Selects TrueSpeech 5.3 play mode. 00185 #define COMPRESS_RATE_TS48 3 // Selects TrueSpeech 4.8 play mode. 00186 #define COMPRESS_RATE_TS41 4 // Selects TrueSpeech 4.1 play mode. 00187 00188 // G.723.1 record/compress modes: 6.3 & 5.3 00189 // NOTE: Same as TrueSpeech 6.3 & 5.3 modes. 00190 #define COMPRESS_RATE_G7231_TS63 1 // Selects TrueSpeech 6.3 play mode. 00191 #define COMPRESS_RATE_G7231_TS53 2 // Selects TrueSpeech 5.3 play mode. 00192 00193 // ------------------------ 00194 00195 #define COMPRESS_FRAME_TRUESPEECH 0 // TrueSpeech 8.5, 6.3, 5.3, 4.8 or 4.1 Kbps 00196 #define COMPRESS_FRAME_ULAW 120 // 64 Kbit/sec U-law PCM 00197 #define COMPRESS_FRAME_16LINEAR 240 // 128 Kbit/sec 16-bit linear 00198 #define COMPRESS_FRAME_8LINEAR 120 // 64 Kbit/sec 8-bit signed linear 00199 #define COMPRESS_FRAME_8LINEAR_WSS 120 // 64 Kbit/sec WSS 8-bit unsigned linear 00200 00201 // TrueSpeech recording modes: 8.5 - 4.1 00202 #define COMPRESS_FRAME_TS85 16 // TrueSpeech 8.5 record frame. 00203 #define COMPRESS_FRAME_TS63 12 // TrueSpeech 6.3 record frame. 00204 #define COMPRESS_FRAME_TS53 10 // TrueSpeech 5.3 record frame. 00205 #define COMPRESS_FRAME_TS48 9 // TrueSpeech 4.8 record frame. 00206 #define COMPRESS_FRAME_TS41 8 // TrueSpeech 4.1 record frame. 00207 00208 // G.723.1 recording modes: 6.3 & 5.3 00209 // NOTE: Same as TrueSpeech 6.3 & 5.3 modes. 00210 #define COMPRESS_FRAME_G7231_TS63 COMPRESS_FRAME_TS63 // TrueSpeech 6.3 record frame. 00211 #define COMPRESS_FRAME_G7231_TS53 COMPRESS_FRAME_TS53 // TrueSpeech 5.3 record frame. 00212 00213 #define COMPRESS_MAX_BUFFER_SIZE COMPRESS_FRAME_16LINEAR // Max buffer size: Tx or Rx. 00214 00215 // Additional bit patterns to 'Or' into Command Base 'words' 00216 const WORD COMPRESS_TFRMODE_80X5 = 0; // Selects Data transfer via Software Control and Status Registers (CT8015/CT8005 protocol mode). 00217 const WORD COMPRESS_TFRMODE_8020 = 3; // Selects Data transfer via Host Transmit Data Buffer Access Port. 00218 00219 const WORD COMPRESS_SYNC_MODE_CODEC = 0; 00220 const WORD COMPRESS_SYNC_MODE_DATA = 1; 00221 const WORD COMPRESS_SYNC_MODE_POLL = 2; 00222 const WORD COMPRESS_SYNC_MODE_HOST = 3; 00223 00224 //========================================================================== 00225 //-------------------------------------------------------------------------- 00226 // Device support 00227 //-------------------------------------------------------------------------- 00228 // 00229 // Additional bit patterns to 'Or' into Command Base 'words' 00230 //const WORD DEVCTRL_TONE_MODE_SYNC = 0; // Selects Synchronous Tone mode 00231 //const WORD DEVCTRL_TONE_MODE_ASYNC = 1; // Selects Asynchronous Tone mode 00232 00233 // Analog source for the Codec #1. 00234 // Analog source is determined by the GPIO bits: 6 & 7. 00235 // | GPIO6 | GPIO7 | 00236 //------------------|-------|-------|------- 00237 // POTS Phone | 0 | 0 | 00238 // Speakerphone | 0 | 1 | 00239 // Handset Phone | 1 | 0 | 00240 // ?????? | 1 | 1 | 00241 //------------------------------------------- 00242 // 00243 #define ANALOG_SOURCE_POTSPHONE (0x0) 00244 #define ANALOG_SOURCE_SPEAKERPHONE (0x1) 00245 #define ANALOG_SOURCE_HANDSETPHONE (0x2) 00246 #define ANALOG_SOURCE_PSTNLINE (0x2) 00247 00248 #define LINEJACK_MODE_PHONEJACK (0x0) 00249 #define LINEJACK_MODE_LINEJACK (0x1) 00250 #define LINEJACK_MODE_STANDALONE (0x2) 00251 00252 #define DEVICE_SPEAKERPHONE 0x01 00253 #define DEVICE_POTS 0x02 00254 #define DEVICE_HANDSET 0x04 00255 #define DEVICE_PSTN 0x08 00256 00257 #define COEFF_US 0 00258 #define COEFF_UK 1 00259 #define COEFF_FRANCE 2 00260 #define COEFF_GERMANY 3 00261 #define COEFF_AUSTRALIA 4 00262 #define COEFF_JAPAN 5 00263 #define COEFF_CTR21 6 00264 #define COEFF_CZECH 7 00265 #define COEFF_GERMANY2 8 00266 #define COEFF_ITALY 9 00267 #define COEFF_SOUTH_KOREA 10 00268 #define COEFF_NEW_ZEALAND 11 00269 #define COEFF_NORWAY 12 00270 #define COEFF_PHILIPPINES 13 00271 #define COEFF_POLAND 14 00272 #define COEFF_SOUTH_AFRICA 15 00273 #define COEFF_SWEDEN 16 00274 00275 // SLIC States 00276 // SLIC State is determined by the GPIO bits: 1,2,3 00277 // | GPIO3 | GPIO2 | GPIO1 | !GPIO1 | 00278 // | C3 | C2 | C1 | B2EN | 00279 //------------------|-------|-------|-------|--------| 00280 // Open Circuit | 0 | 0 | 0 | 1 | 00281 // Ringing | 0 | 0 | 1 | 0 | 00282 // Active | 0 | 1 | 0 | 1 | 00283 //---------------------------------------------------- 00284 // 00285 #define SLIC_STATE_OPENCIRCUIT 0 00286 #define SLIC_STATE_RINGING 1 00287 #define SLIC_STATE_ACTIVE 2 00288 #define SLIC_STATE_OHT 3 00289 #define SLIC_STATE_TIPOPEN 4 00290 #define SLIC_STATE_STANDBY 5 00291 #define SLIC_STATE_APR 6 00292 #define SLIC_STATE_OHTPR 7 00293 00294 // Switch Hook States 00295 // Switch Hook State is determined by GPIO 5 00296 // | GPIO5 | 00297 //------------------|--------| 00298 // Off Hook | 0 | 00299 // On Hook | 1 | 00300 //---------------------------- 00301 // 00302 #define SLIC_OFF_HOOK (0x0) 00303 #define SLIC_ON_HOOK (0x1) 00304 00305 // LineJack Test error codes 00306 #define LINE_TEST_OK 0 00307 #define LINE_TEST_TESTING 1 00308 #define LINE_TEST_POTS_OFF_HOOK 2 00309 #define LINE_TEST_LINE_CONNECTED_TO_POTS 3 00310 #define LINE_TEST_NO_LINE_PRESENT 4 00311 00312 // The ring pattern is a 12-bit sequence. 00313 // Each bit represents 1/2 second of ring 00314 // on or off for a total of 6 seconds. 00315 #define RING_PATTERN_MASK (0x0FFF) 00316 00317 #define DEVCTRL_HOOKSTATE_INIT 0 00318 #define DEVCTRL_HOOKSTATE_ON_HOOK_1 1 00319 #define DEVCTRL_HOOKSTATE_ON_HOOK_2 2 00320 #define DEVCTRL_HOOKSTATE_ON_HOOK_3 3 00321 #define DEVCTRL_HOOKSTATE_OFF_HOOK_1 4 00322 #define DEVCTRL_HOOKSTATE_OFF_HOOK_2 5 00323 #define DEVCTRL_HOOKSTATE_OFF_HOOK_3 6 00324 00325 #define DEVCTRL_RINGSTATE_INIT 0 00326 #define DEVCTRL_RINGSTATE_RING_0 1 00327 #define DEVCTRL_RINGSTATE_RING_1 2 00328 #define DEVCTRL_RINGSTATE_RING_2 3 00329 #define DEVCTRL_RINGSTATE_RING_3 4 00330 #define DEVCTRL_RINGSTATE_RING_4 5 00331 #define DEVCTRL_RINGSTATE_RING_5 6 00332 #define DEVCTRL_RINGSTATE_RING_6 7 00333 #define DEVCTRL_RINGSTATE_RING_7 8 00334 #define DEVCTRL_RINGSTATE_RING_8 9 00335 #define DEVCTRL_RINGSTATE_RING_9 10 00336 #define DEVCTRL_RINGSTATE_RING_10 11 00337 #define DEVCTRL_RINGSTATE_RING_11 12 00338 00339 //========================================================================== 00340 //-------------------------------------------------------------------------- 00341 // Filter support 00342 //-------------------------------------------------------------------------- 00343 // 00344 // Additional bit patterns to 'Or' into Command Base 'words' 00345 #define FILTER_MODE_SYNC 0 00346 #define FILTER_MODE_ASYNC 1 00347 00348 #define FILTER_LINE_VOLUME_POS_0DB 2 // +0 dB 00349 #define FILTER_LINE_VOLUME_MUTE 3 // Mute Microphone (also resets AEC) 00350 00351 #define FILTER_SPEAKER_VOLUME_POS_14DB 0 // +14 dB 00352 #define FILTER_SPEAKER_VOLUME_POS_12DB 1 // +12 dB 00353 #define FILTER_SPEAKER_VOLUME_POS_10DB 2 // +10 dB 00354 #define FILTER_SPEAKER_VOLUME_POS_8DB 3 // +8 dB 00355 #define FILTER_SPEAKER_VOLUME_POS_6DB 4 // +6 dB 00356 #define FILTER_SPEAKER_VOLUME_POS_4DB 5 // +4 dB 00357 #define FILTER_SPEAKER_VOLUME_POS_2DB 6 // +2 dB 00358 #define FILTER_SPEAKER_VOLUME_POS_0DB 7 // 0 dB 00359 #define FILTER_SPEAKER_VOLUME_NEG_2DB 8 // -2 dB 00360 #define FILTER_SPEAKER_VOLUME_NEG_4DB 9 // -4 dB 00361 #define FILTER_SPEAKER_VOLUME_NEG_6DB 10 // -6 dB 00362 #define FILTER_SPEAKER_VOLUME_NEG_8DB 11 // -8 dB 00363 #define FILTER_SPEAKER_VOLUME_NEG_10DB 12 // -10 dB 00364 #define FILTER_SPEAKER_VOLUME_NEG_12DB 13 // -12 dB 00365 #define FILTER_SPEAKER_VOLUME_NEG_14DB 14 // -14 dB 00366 #define FILTER_SPEAKER_VOLUME_MUTE 15 // Mute Filter 00367 00368 #define FILTER_DTMFSTATE_INIT 0 00369 #define FILTER_DTMFSTATE_NOT_VALID_1 1 00370 #define FILTER_DTMFSTATE_NOT_VALID_2 2 00371 #define FILTER_DTMFSTATE_NOT_VALID_3 3 00372 #define FILTER_DTMFSTATE_VALID_1 4 00373 #define FILTER_DTMFSTATE_VALID_2 5 00374 #define FILTER_DTMFSTATE_VALID_3 6 00375 00376 #define FrameCount( LineMonitor ) ((LineMonitor>>12)&0x0f) 00377 #define FilterBits( LineMonitor ) ((LineMonitor>>8)&0x0f) 00378 #define Peak( LineMonitor ) ((LineMonitor>>6)&1) 00379 #define DTMFValid( LineMonitor ) ((LineMonitor>>5)&1) 00380 #define CPFValid( LineMonitor ) ((LineMonitor>>4)&1) 00381 #define DTMFDigit( LineMonitor ) (LineMonitor&0x0f) 00382 00383 00384 //========================================================================== 00385 //-------------------------------------------------------------------------- 00386 // Idle support 00387 //-------------------------------------------------------------------------- 00388 // 00389 #define IDLE_TONE_MODE_SYNC 0 // Selects Synchronous Tone mode 00390 #define IDLE_TONE_MODE_ASYNC 1 // Selects Asynchronous Tone mode 00391 00392 #define IDLE_TONE_NOTONE 0 00393 #define IDLE_TONE_1 1 00394 #define IDLE_TONE_2 2 00395 #define IDLE_TONE_3 3 00396 #define IDLE_TONE_4 4 00397 #define IDLE_TONE_5 5 00398 #define IDLE_TONE_6 6 00399 #define IDLE_TONE_7 7 00400 #define IDLE_TONE_8 8 00401 #define IDLE_TONE_9 9 00402 #define IDLE_TONE_STAR 10 00403 #define IDLE_TONE_0 11 00404 #define IDLE_TONE_POUND 12 00405 #define IDLE_TONE_DIAL 25 00406 #define IDLE_TONE_RING 26 00407 #define IDLE_TONE_BUSY 27 00408 #define IDLE_TONE_A 28 00409 #define IDLE_TONE_B 29 00410 #define IDLE_TONE_C 30 00411 #define IDLE_TONE_D 31 00412 00413 // Table from TelTone M-991 Spec sheet (table 4). 00414 // Tone Name Frequency (Hz) Interruption Rate 00415 // 1 2 00416 //------------------------------------------------------------------------------------------- 00417 // Dial | 350 | 440 | Steady 00418 // Reorder | 480 | 620 | Repeat, tones on and off 250 ms +- 25ms 00419 // Busy | 480 | 620 | Repeat, tones on and off 500 ms +- 50ms 00420 // Audible Ring | 480 | 480 | Repeat, tones on 2 +- 0.2sec, tones off 4 +- 0.4sec 00421 // Recall Dial | 350 | 440 | Three bursts tones on and off 100 ms +- 20ms each followed by dial tone 00422 // Special AR | 440 | 480 | Tones on 1 +- 0.2sec, followed by single 440Hz on for 0.2sec on, and silence for 3 +- 0.3sec, repeat 00423 // Intercept | 440 | 620 | Repeat alternating tones, each on for 230ms +- 70ms with total cycle of 500 +- 50ms 00424 // Call Waiting | 440 | Off | One burst 200 +- 100ms 00425 // Busy Verification | 440 | Off | One burst of tone on 1.75 +- 0.25sec before attendant intrudes, followed by burst of tone 0.65 +- 0.15sec on, 8 to 20 sec apart for as long as the call lasts. 00426 // Executive Override | 440 | Off | One burst of tone for 3 +- 1sec before overriding station intrudes. 00427 // Confirmation | 350 | 440 | Three bursts on and off 100ms each or 100ms on, 100ms off, 300 ms on. 00428 00429 #define TONE_DIAL 0 00430 #define TONE_REORDER 1 00431 #define TONE_BUSY 2 00432 #define TONE_AUDIBLE_RING 3 00433 #define TONE_RECALL_DIAL 4 00434 #define TONE_SPECIAL_AR 5 00435 #define TONE_INTERCEPT 6 00436 #define TONE_CALL_WAITING 7 00437 #define TONE_BUSY_VERIFICATION 8 00438 #define TONE_EXECUTIVE_OVERRIDE 9 00439 #define TONE_CONFIRMATION 10 00440 00441 typedef struct 00442 { 00443 DWORD dwToneIndex; 00444 DWORD dwDuration; 00445 DWORD dwToneOnPeriod; 00446 DWORD dwToneOffPeriod; 00447 DWORD dwMasterGain; 00448 } IDLE_TONE; 00449 00450 typedef struct 00451 { 00452 DWORD dwToneIndex; // 1-31, 0 reserved for silence 00453 DWORD dwFrequencyFactor0; // dwFrequencyFactor0 = 32767 * cos( 2*Pi*(frequency0/8000) ) 00454 DWORD dwGain0; // 0-15 See Tone Level Table 00455 DWORD dwFrequencyFactor1; // dwFrequencyFactor1 = 32767 * cos( 2*Pi*(frequency1/8000) ) 00456 DWORD dwGain1; // 0-15 See Tone Level Table 00457 } IDLE_NEW_TONE; 00458 00459 //========================================================================== 00460 // 00461 // Tone Level Table 00462 //____________________________________________________________ 00463 // Index Codec Output Level (dB relative to 0.707 Vrms) 00464 //____________________________________________________________ 00465 // 0 +6 00466 // 1 +4 00467 // 2 +2 00468 // 3 0 00469 // 4 -2 00470 // 5 -4 00471 // 6 -6 00472 // 7 -8 00473 // 8 -10 00474 // 9 -12 00475 // 10 -14 00476 // 11 -16 00477 // 12 -18 00478 // 13 -20 00479 // 14 -22 00480 // 15 -24 00481 00482 //========================================================================== 00483 //-------------------------------------------------------------------------- 00484 // Mixer support 00485 //-------------------------------------------------------------------------- 00486 // 00487 // Playback mixer lines 00488 #define PlaybackMaster 0 00489 #define PlaybackMicrophone 1 00490 #define PlaybackWave 2 00491 #define PlaybackCD 3 00492 #define PlaybackLineIn 4 00493 #define PlaybackPhoneIn 5 00494 #define PlaybackPhoneOut 6 00495 #define PlaybackPhoneLineOut 7 00496 #define PlaybackDeviceCount 8 00497 00498 // Record mixer lines 00499 #define RecordMaster 0 00500 #define RecordMicrophone 1 00501 #define RecordWave 2 00502 #define RecordCD 3 00503 #define RecordLineIn 4 00504 #define RecordPhoneIn 5 00505 #define RecordPhoneLineIn 6 00506 #define RecordDeviceCount 7 00507 00508 // Output mixer lines 00509 #define OutputMicrophone PlaybackMicrophone 00510 #define OutputWave PlaybackWave 00511 #define OutputCD PlaybackCD 00512 #define OutputLineIn PlaybackLineIn 00513 #define OutputPhoneIn PlaybackPhoneIn 00514 00515 // Input mixer lines 00516 #define InputMicrophone RecordMicrophone 00517 #define InputWave RecordWave 00518 #define InputCD RecordCD 00519 #define InputLineIn RecordLineIn 00520 #define InputPhoneIn RecordPhoneIn 00521 00522 // Mixer line structure 00523 typedef struct _MIXER_LINE 00524 { 00525 DWORD dwLineID; 00526 DWORD dwMute; 00527 DWORD dwLeftVolume; 00528 DWORD dwRightVolume; 00529 } 00530 MIXER_LINE; 00531 00532 #define MIXER_ACCESS TEXT( "MixerAccess" ) 00533 00534 //========================================================================== 00535 //-------------------------------------------------------------------------- 00536 // Playback support 00537 //-------------------------------------------------------------------------- 00538 // 00539 // Additional bit patterns to 'Or' into Command Base 'words' 00540 #define PLAYBACK_TFRMODE_80X5 0 // Selects Data transfer via Software Control and Status Registers (CT8015/CT8005 protocol mode). 00541 #define PLAYBACK_TFRMODE_8020 3 // Selects Data transfer via Host Transmit Data Buffer Access Port. 00542 00543 #define PLAYBACK_SYNC_MODE_CODEC 0 00544 #define PLAYBACK_SYNC_MODE_DATA 1 00545 #define PLAYBACK_SYNC_MODE_POLL 2 00546 #define PLAYBACK_SYNC_MODE_HOST 3 00547 00548 // Playback modes 00549 #define PLAYBACK_MODE_COMPRESSED 0 // Selects: Compressed modes, TrueSpeech 8.5-4.1, G.723.1, G.722, G.728, G.729 00550 #define PLAYBACK_MODE_TRUESPEECH_V40 0 // Selects: TrueSpeech 8.5, 6.3, 5.3, 4.8 or 4.1 Kbps 00551 #define PLAYBACK_MODE_TRUESPEECH 8 // Selects: TrueSpeech 8.5, 6.3, 5.3, 4.8 or 4.1 Kbps Version 5.1 00552 #define PLAYBACK_MODE_ULAW 2 // Selects: 64 Kbit/sec MuA-law PCM 00553 #define PLAYBACK_MODE_ALAW 10 // Selects: 64 Kbit/sec A-law PCM 00554 #define PLAYBACK_MODE_16LINEAR 6 // Selects: 128 Kbit/sec 16-bit linear 00555 #define PLAYBACK_MODE_8LINEAR 4 // Selects: 64 Kbit/sec 8-bit signed linear 00556 #define PLAYBACK_MODE_8LINEAR_WSS 5 // Selects: 64 Kbit/sec WSS 8-bit unsigned linear 00557 00558 // Playback rates 00559 #define PLAYBACK_RATE_TS85 0 // Selects TrueSpeech 8.5 playback rate. 00560 #define PLAYBACK_RATE_TS63 1 // Selects TrueSpeech 6.3 playback rate. 00561 #define PLAYBACK_RATE_TS53 2 // Selects TrueSpeech 5.3 playback rate. 00562 #define PLAYBACK_RATE_TS48 3 // Selects TrueSpeech 4.8 playback rate. 00563 #define PLAYBACK_RATE_TS41 4 // Selects TrueSpeech 4.1 playback rate. 00564 #define PLAYBACK_RATE_G722 7 // Selects G.722 playback rate. 00565 #define PLAYBACK_RATE_G723_63 PLAYBACK_RATE_TS63 // Selects G.723.1 (6.3 kbps) playback rate. 00566 #define PLAYBACK_RATE_G723_53 PLAYBACK_RATE_TS53 // Selects G.723.1 (5.3 kbps) playback rate. 00567 #define PLAYBACK_RATE_G728 5 // Selects G.728 playback rate. 00568 #define PLAYBACK_RATE_G729 6 // Selects G.729 playback rate. 00569 00570 // Frame sizes in WORD units 00571 #define PLAYBACK_TS85_WORDS 16 // TrueSpeech 8.5, 30ms frame size 00572 #define PLAYBACK_TS63_WORDS 12 // TrueSpeech 6.3, 30ms frame size 00573 #define PLAYBACK_TS53_WORDS 10 // TrueSpeech 5.3, 30ms frame size 00574 #define PLAYBACK_TS48_WORDS 9 // TrueSpeech 4.8, 30ms frame size 00575 #define PLAYBACK_TS41_WORDS 8 // TrueSpeech 4.1, 30ms frame size 00576 #define PLAYBACK_ALAW_WORDS 120 // 64 Kbit/sec A-law PCM, 30ms frame size 00577 #define PLAYBACK_ALAW_30MS_WORDS 120 // 64 Kbit/sec A-law PCM, 30ms frame size 00578 #define PLAYBACK_ALAW_20MS_WORDS 80 // 64 Kbit/sec A-law PCM, 20ms frame size 00579 #define PLAYBACK_ALAW_10MS_WORDS 40 // 64 Kbit/sec A-law PCM, 10ms frame size 00580 #define PLAYBACK_ULAW_WORDS 120 // 64 Kbit/sec Mu-law PCM, 30ms frame size 00581 #define PLAYBACK_ULAW_30MS_WORDS 120 // 64 Kbit/sec Mu-law PCM, 30ms frame size 00582 #define PLAYBACK_ULAW_20MS_WORDS 80 // 64 Kbit/sec Mu-law PCM, 20ms frame size 00583 #define PLAYBACK_ULAW_10MS_WORDS 40 // 64 Kbit/sec Mu-law PCM, 10ms frame size 00584 #define PLAYBACK_16LINEAR_WORDS 240 // 128 Kbit/sec 16-bit linear, 30ms frame size 00585 #define PLAYBACK_16LINEAR_30MS_WORDS 240 // 128 Kbit/sec 16-bit linear, 30ms frame size 00586 #define PLAYBACK_16LINEAR_20MS_WORDS 160 // 128 Kbit/sec 16-bit linear, 20ms frame size 00587 #define PLAYBACK_16LINEAR_10MS_WORDS 80 // 128 Kbit/sec 16-bit linear, 10ms frame size 00588 #define PLAYBACK_8LINEAR_WORDS 120 // 64 Kbit/sec 8-bit signed linear, 30ms frame size 00589 #define PLAYBACK_8LINEAR_30MS_WORDS 120 // 64 Kbit/sec 8-bit signed linear, 30ms frame size 00590 #define PLAYBACK_8LINEAR_20MS_WORDS 80 // 64 Kbit/sec 8-bit signed linear, 20ms frame size 00591 #define PLAYBACK_8LINEAR_10MS_WORDS 40 // 64 Kbit/sec 8-bit signed linear, 10ms frame size 00592 #define PLAYBACK_8LINEAR_WSS_WORDS 120 // 64 Kbit/sec WSS 8-bit unsigned linear, 30ms frame size 00593 #define PLAYBACK_8LINEAR_WSS_30MS_WORDS 120 // 64 Kbit/sec WSS 8-bit unsigned linear, 30ms frame size 00594 #define PLAYBACK_8LINEAR_WSS_20MS_WORDS 80 // 64 Kbit/sec WSS 8-bit unsigned linear, 20ms frame size 00595 #define PLAYBACK_8LINEAR_WSS_10MS_WORDS 40 // 64 Kbit/sec WSS 8-bit unsigned linear, 10ms frame size 00596 #define PLAYBACK_G722_WORDS 40 // 64 Kbit/sec G.722, 10ms frame size 00597 #define PLAYBACK_G723_63_WORDS PLAYBACK_TS63_WORDS // 6.3 Kbit/sec G.723.1, 30ms frame size 00598 #define PLAYBACK_G723_53_WORDS PLAYBACK_TS53_WORDS // 5.3 Kbit/sec G.723.1, 30ms frame size 00599 #define PLAYBACK_G728_10MS_WORDS 16 // 16 Kbit/sec G.728, 10ms frame size 00600 #define PLAYBACK_G728_20MS_WORDS 32 // 16 Kbit/sec G.728, 20ms frame size 00601 #define PLAYBACK_G728_30MS_WORDS 48 // 16 Kbit/sec G.728, 30ms frame size 00602 #define PLAYBACK_G729_10MS_WORDS 6 // 8 Kbit/sec G.729, 10ms frame size 00603 #define PLAYBACK_G729_20MS_WORDS 12 // 8 Kbit/sec G.729, 20ms frame size 00604 #define PLAYBACK_G729_30MS_WORDS 18 // 8 Kbit/sec G.729, 30ms frame size 00605 00606 // Frame sizes in bytes 00607 #define PLAYBACK_FRAME_TS85 (PLAYBACK_TS85_WORDS*2) 00608 #define PLAYBACK_FRAME_TS63 (PLAYBACK_TS63_WORDS*2) 00609 #define PLAYBACK_FRAME_TS53 (PLAYBACK_TS53_WORDS*2) 00610 #define PLAYBACK_FRAME_TS48 (PLAYBACK_TS48_WORDS*2) 00611 #define PLAYBACK_FRAME_TS41 (PLAYBACK_TS41_WORDS*2) 00612 #define PLAYBACK_FRAME_ALAW (PLAYBACK_ALAW_WORDS*2) 00613 #define PLAYBACK_FRAME_ALAW_30MS (PLAYBACK_ALAW_30MS_WORDS*2) 00614 #define PLAYBACK_FRAME_ALAW_20MS (PLAYBACK_ALAW_20MS_WORDS*2) 00615 #define PLAYBACK_FRAME_ALAW_10MS (PLAYBACK_ALAW_10MS_WORDS*2) 00616 #define PLAYBACK_FRAME_ULAW (PLAYBACK_ULAW_WORDS*2) 00617 #define PLAYBACK_FRAME_ULAW_30MS (PLAYBACK_ULAW_30MS_WORDS*2) 00618 #define PLAYBACK_FRAME_ULAW_20MS (PLAYBACK_ULAW_20MS_WORDS*2) 00619 #define PLAYBACK_FRAME_ULAW_10MS (PLAYBACK_ULAW_10MS_WORDS*2) 00620 #define PLAYBACK_FRAME_16LINEAR (PLAYBACK_16LINEAR_WORDS*2) 00621 #define PLAYBACK_FRAME_16LINEAR_30MS (PLAYBACK_16LINEAR_30MS_WORDS*2) 00622 #define PLAYBACK_FRAME_16LINEAR_20MS (PLAYBACK_16LINEAR_20MS_WORDS*2) 00623 #define PLAYBACK_FRAME_16LINEAR_10MS (PLAYBACK_16LINEAR_10MS_WORDS*2) 00624 #define PLAYBACK_FRAME_8LINEAR (PLAYBACK_8LINEAR_WORDS*2) 00625 #define PLAYBACK_FRAME_8LINEAR_30MS (PLAYBACK_8LINEAR_30MS_WORDS*2) 00626 #define PLAYBACK_FRAME_8LINEAR_20MS (PLAYBACK_8LINEAR_20MS_WORDS*2) 00627 #define PLAYBACK_FRAME_8LINEAR_10MS (PLAYBACK_8LINEAR_10MS_WORDS*2) 00628 #define PLAYBACK_FRAME_8LINEAR_WSS (PLAYBACK_8LINEAR_WSS_WORDS*2) 00629 #define PLAYBACK_FRAME_8LINEAR_WSS_30MS (PLAYBACK_8LINEAR_WSS_30MS_WORDS*2) 00630 #define PLAYBACK_FRAME_8LINEAR_WSS_20MS (PLAYBACK_8LINEAR_WSS_20MS_WORDS*2) 00631 #define PLAYBACK_FRAME_8LINEAR_WSS_10MS (PLAYBACK_8LINEAR_WSS_10MS_WORDS*2) 00632 #define PLAYBACK_FRAME_G722 (PLAYBACK_G722_WORDS*2) 00633 #define PLAYBACK_FRAME_G723_63 (PLAYBACK_G723_63_WORDS*2) 00634 #define PLAYBACK_FRAME_G723_53 (PLAYBACK_G723_53_WORDS*2) 00635 #define PLAYBACK_FRAME_G728_10MS (PLAYBACK_G728_10MS_WORDS*2) 00636 #define PLAYBACK_FRAME_G728_20MS (PLAYBACK_G728_20MS_WORDS*2) 00637 #define PLAYBACK_FRAME_G728_30MS (PLAYBACK_G728_30MS_WORDS*2) 00638 #define PLAYBACK_FRAME_G729_10MS (PLAYBACK_G729_10MS_WORDS*2) 00639 #define PLAYBACK_FRAME_G729_20MS (PLAYBACK_G729_20MS_WORDS*2) 00640 #define PLAYBACK_FRAME_G729_30MS (PLAYBACK_G729_30MS_WORDS*2) 00641 00642 #define PLAYBACK_MAX_BUFFER_WORDS PLAYBACK_16LINEAR_WORDS // Max buffer size: Tx or Rx. 00643 #define PLAYBACK_MAX_BUFFER_SIZE PLAYBACK_FRAME_16LINEAR // Max buffer size: Tx or Rx. 00644 00645 #define PLAYBACK_TS85_AVG_RATE 1067 // TrueSpeech 8.5 Average bytes per second. 00646 #define PLAYBACK_TS63_AVG_RATE 800 // TrueSpeech 6.3 Average bytes per second. 00647 #define PLAYBACK_TS53_AVG_RATE 667 // TrueSpeech 5.3 Average bytes per second. 00648 #define PLAYBACK_TS48_AVG_RATE 600 // TrueSpeech 4.8 Average bytes per second. 00649 #define PLAYBACK_TS41_AVG_RATE 533 // TrueSpeech 4.1 Average bytes per second. 00650 00651 //========================================================================== 00652 //-------------------------------------------------------------------------- 00653 // Record support 00654 //-------------------------------------------------------------------------- 00655 // 00656 // Additional bit patterns to 'Or' into Command Base 'words' 00657 #define RECORD_TFRMODE_80X5 0 // Selects Data transfer via Software Control and Status Registers (CT8015/CT8005 protocol mode). 00658 #define RECORD_TFRMODE_8020 3 // Selects Data transfer via Host Transmit Data Buffer Access Port. 00659 00660 #define RECORD_SYNC_MODE_CODEC 0 00661 #define RECORD_SYNC_MODE_DATA 1 00662 #define RECORD_SYNC_MODE_POLL 2 00663 #define RECORD_SYNC_MODE_HOST 3 00664 00665 // Automatic Gain Control (AGC) 00666 #define RECORD_AGC_MIN_GAIN 0 // Sets AGC Min Gain 00667 #define RECORD_AGC_MAX_GAIN 1 // Sets AGC Max Gain 00668 #define RECORD_AGC_START_GAIN 2 // Sets AGC Start Gain 00669 #define RECORD_AGC_HOLD_TIME 3 // Sets AGC Hold Time 00670 #define RECORD_AGC_ATTACK_TIME 4 // Sets AGC Attack Time Constant 00671 #define RECORD_AGC_DECAY_TIME 5 // Sets AGC Decay Time Constant 00672 #define RECORD_AGC_ATTACK_THRES 6 // Sets AGC Attack Threshold 00673 #define RECORD_AGC_ON_OFF 7 // Sets AGC On/Off. Enable/Disable AGC. 00674 00675 // AGC Time Contants 00676 #define RECORD_AGC_250_us 0 00677 #define RECORD_AGC_512_us 1 00678 #define RECORD_AGC_1_ms 2 00679 #define RECORD_AGC_2_ms 3 00680 #define RECORD_AGC_4_ms 4 00681 #define RECORD_AGC_8_ms 5 00682 #define RECORD_AGC_16_ms 6 00683 #define RECORD_AGC_32_ms 7 00684 #define RECORD_AGC_64_ms 8 00685 #define RECORD_AGC_128_ms 9 00686 #define RECORD_AGC_256_ms 10 00687 #define RECORD_AGC_512_ms 11 00688 #define RECORD_AGC_1024_ms 12 00689 #define RECORD_AGC_2048_ms 13 00690 #define RECORD_AGC_4096_ms 14 00691 #define RECORD_AGC_8192_ms 15 00692 00693 // Record modes 00694 #define RECORD_MODE_COMPRESSED 0 // Selects: Compressed modes, TrueSpeech 8.5-4.1, G.723.1, G.722, G.728, G.729 00695 #define RECORD_MODE_TRUESPEECH 0 // Selects: TrueSpeech 8.5, 6.3, 5.3, 4.8 or 4.1 Kbps 00696 #define RECORD_MODE_ULAW 4 // Selects: 64 Kbit/sec Mu-law PCM 00697 #define RECORD_MODE_ALAW 12 // Selects: 64 Kbit/sec A-law PCM 00698 #define RECORD_MODE_16LINEAR 5 // Selects: 128 Kbit/sec 16-bit linear 00699 #define RECORD_MODE_8LINEAR 6 // Selects: 64 Kbit/sec 8-bit signed linear 00700 #define RECORD_MODE_8LINEAR_WSS 7 // Selects: 64 Kbit/sec WSS 8-bit unsigned linear 00701 00702 // Record rates 00703 #define RECORD_RATE_TS85 0 // Selects TrueSpeech 8.5 record rate. 00704 #define RECORD_RATE_TS63 1 // Selects TrueSpeech 6.3 record rate. 00705 #define RECORD_RATE_TS53 2 // Selects TrueSpeech 5.3 record rate. 00706 #define RECORD_RATE_TS48 3 // Selects TrueSpeech 4.8 record rate. 00707 #define RECORD_RATE_TS41 4 // Selects TrueSpeech 4.1 record rate. 00708 #define RECORD_RATE_G722 7 // Selects G.722 record rate. 00709 #define RECORD_RATE_G723_63 RECORD_RATE_TS63 // Selects G.723.1 (6.3 kbps) record rate. 00710 #define RECORD_RATE_G723_53 RECORD_RATE_TS53 // Selects G.723.1 (5.3 kbps) record rate. 00711 #define RECORD_RATE_G728 5 // Selects G.728 record rate. 00712 #define RECORD_RATE_G729 6 // Selects G.729 record rate. 00713 00714 // Frame sizes in WORD units 00715 #define RECORD_TS85_WORDS 16 // TrueSpeech 8.5, 30ms frame size 00716 #define RECORD_TS63_WORDS 12 // TrueSpeech 6.3, 30ms frame size 00717 #define RECORD_TS53_WORDS 10 // TrueSpeech 5.3, 30ms frame size 00718 #define RECORD_TS48_WORDS 9 // TrueSpeech 4.8, 30ms frame size 00719 #define RECORD_TS41_WORDS 8 // TrueSpeech 4.1, 30ms frame size 00720 #define RECORD_ALAW_WORDS 120 // 64 Kbit/sec A-law PCM, 30ms frame size 00721 #define RECORD_ALAW_30MS_WORDS 120 // 64 Kbit/sec A-law PCM, 30ms frame size 00722 #define RECORD_ALAW_20MS_WORDS 80 // 64 Kbit/sec A-law PCM, 20ms frame size 00723 #define RECORD_ALAW_10MS_WORDS 40 // 64 Kbit/sec A-law PCM, 10ms frame size 00724 #define RECORD_ULAW_WORDS 120 // 64 Kbit/sec Mu-law PCM, 30ms frame size 00725 #define RECORD_ULAW_30MS_WORDS 120 // 64 Kbit/sec Mu-law PCM, 30ms frame size 00726 #define RECORD_ULAW_20MS_WORDS 80 // 64 Kbit/sec Mu-law PCM, 20ms frame size 00727 #define RECORD_ULAW_10MS_WORDS 40 // 64 Kbit/sec Mu-law PCM, 10ms frame size 00728 #define RECORD_16LINEAR_WORDS 240 // 128 Kbit/sec 16-bit linear, 30ms frame size 00729 #define RECORD_16LINEAR_30MS_WORDS 240 // 128 Kbit/sec 16-bit linear, 30ms frame size 00730 #define RECORD_16LINEAR_20MS_WORDS 160 // 128 Kbit/sec 16-bit linear, 20ms frame size 00731 #define RECORD_16LINEAR_10MS_WORDS 80 // 128 Kbit/sec 16-bit linear, 10ms frame size 00732 #define RECORD_8LINEAR_WORDS 120 // 64 Kbit/sec 8-bit signed linear, 30ms frame size 00733 #define RECORD_8LINEAR_30MS_WORDS 120 // 64 Kbit/sec 8-bit signed linear, 30ms frame size 00734 #define RECORD_8LINEAR_20MS_WORDS 80 // 64 Kbit/sec 8-bit signed linear, 20ms frame size 00735 #define RECORD_8LINEAR_10MS_WORDS 40 // 64 Kbit/sec 8-bit signed linear, 10ms frame size 00736 #define RECORD_8LINEAR_WSS_WORDS 120 // 64 Kbit/sec WSS 8-bit unsigned linear, 30ms frame size 00737 #define RECORD_8LINEAR_WSS_30MS_WORDS 120 // 64 Kbit/sec WSS 8-bit unsigned linear, 30ms frame size 00738 #define RECORD_8LINEAR_WSS_20MS_WORDS 80 // 64 Kbit/sec WSS 8-bit unsigned linear, 20ms frame size 00739 #define RECORD_8LINEAR_WSS_10MS_WORDS 40 // 64 Kbit/sec WSS 8-bit unsigned linear, 10ms frame size 00740 #define RECORD_G722_WORDS 40 // 64 Kbit/sec G.722, 10ms frame size 00741 #define RECORD_G723_63_WORDS RECORD_TS63_WORDS // 6.3 Kbit/sec G.723.1, 30ms frame size 00742 #define RECORD_G723_53_WORDS RECORD_TS53_WORDS // 5.3 Kbit/sec G.723.1, 30ms frame size 00743 #define RECORD_G728_10MS_WORDS 16 // 16 Kbit/sec G.728, 10ms frame size 00744 #define RECORD_G728_20MS_WORDS 32 // 16 Kbit/sec G.728, 20ms frame size 00745 #define RECORD_G728_30MS_WORDS 48 // 16 Kbit/sec G.728, 30ms frame size 00746 #define RECORD_G729_10MS_WORDS 6 // 8 Kbit/sec G.729, 10ms frame size 00747 #define RECORD_G729_20MS_WORDS 12 // 8 Kbit/sec G.729, 20ms frame size 00748 #define RECORD_G729_30MS_WORDS 18 // 8 Kbit/sec G.729, 30ms frame size 00749 00750 // Frame sizes in bytes 00751 #define RECORD_FRAME_TS85 (RECORD_TS85_WORDS*2) 00752 #define RECORD_FRAME_TS63 (RECORD_TS63_WORDS*2) 00753 #define RECORD_FRAME_TS53 (RECORD_TS53_WORDS*2) 00754 #define RECORD_FRAME_TS48 (RECORD_TS48_WORDS*2) 00755 #define RECORD_FRAME_TS41 (RECORD_TS41_WORDS*2) 00756 #define RECORD_FRAME_ALAW (RECORD_ALAW_WORDS*2) 00757 #define RECORD_FRAME_ALAW_30MS (RECORD_ALAW_30MS_WORDS*2) 00758 #define RECORD_FRAME_ALAW_20MS (RECORD_ALAW_20MS_WORDS*2) 00759 #define RECORD_FRAME_ALAW_10MS (RECORD_ALAW_10MS_WORDS*2) 00760 #define RECORD_FRAME_ULAW (RECORD_ULAW_WORDS*2) 00761 #define RECORD_FRAME_ULAW_30MS (RECORD_ULAW_30MS_WORDS*2) 00762 #define RECORD_FRAME_ULAW_20MS (RECORD_ULAW_20MS_WORDS*2) 00763 #define RECORD_FRAME_ULAW_10MS (RECORD_ULAW_10MS_WORDS*2) 00764 #define RECORD_FRAME_16LINEAR (RECORD_16LINEAR_WORDS*2) 00765 #define RECORD_FRAME_16LINEAR_30MS (RECORD_16LINEAR_30MS_WORDS*2) 00766 #define RECORD_FRAME_16LINEAR_20MS (RECORD_16LINEAR_20MS_WORDS*2) 00767 #define RECORD_FRAME_16LINEAR_10MS (RECORD_16LINEAR_10MS_WORDS*2) 00768 #define RECORD_FRAME_8LINEAR (RECORD_8LINEAR_WORDS*2) 00769 #define RECORD_FRAME_8LINEAR_30MS (RECORD_8LINEAR_30MS_WORDS*2) 00770 #define RECORD_FRAME_8LINEAR_20MS (RECORD_8LINEAR_20MS_WORDS*2) 00771 #define RECORD_FRAME_8LINEAR_10MS (RECORD_8LINEAR_10MS_WORDS*2) 00772 #define RECORD_FRAME_8LINEAR_WSS (RECORD_8LINEAR_WSS_WORDS*2) 00773 #define RECORD_FRAME_8LINEAR_WSS_30MS (RECORD_8LINEAR_WSS_30MS_WORDS*2) 00774 #define RECORD_FRAME_8LINEAR_WSS_20MS (RECORD_8LINEAR_WSS_20MS_WORDS*2) 00775 #define RECORD_FRAME_8LINEAR_WSS_10MS (RECORD_8LINEAR_WSS_10MS_WORDS*2) 00776 #define RECORD_FRAME_G722 (RECORD_G722_WORDS*2) 00777 #define RECORD_FRAME_G723_63 (RECORD_G723_63_WORDS*2) 00778 #define RECORD_FRAME_G723_53 (RECORD_G723_53_WORDS*2) 00779 #define RECORD_FRAME_G728_10MS (RECORD_G728_10MS_WORDS*2) 00780 #define RECORD_FRAME_G728_20MS (RECORD_G728_20MS_WORDS*2) 00781 #define RECORD_FRAME_G728_30MS (RECORD_G728_30MS_WORDS*2) 00782 #define RECORD_FRAME_G729_10MS (RECORD_G729_10MS_WORDS*2) 00783 #define RECORD_FRAME_G729_20MS (RECORD_G729_20MS_WORDS*2) 00784 #define RECORD_FRAME_G729_30MS (RECORD_G729_30MS_WORDS*2) 00785 00786 #define RECORD_MAX_BUFFER_WORDS RECORD_16LINEAR_WORDS // Max buffer size: Tx or Rx. 00787 #define RECORD_MAX_BUFFER_SIZE RECORD_FRAME_16LINEAR // Max buffer size: Tx or Rx. 00788 00789 #define RECORD_TS85_AVG_RATE 1067 // TrueSpeech 8.5 Average bytes per second. 00790 #define RECORD_TS63_AVG_RATE 800 // TrueSpeech 6.3 Average bytes per second. 00791 #define RECORD_TS53_AVG_RATE 667 // TrueSpeech 5.3 Average bytes per second. 00792 #define RECORD_TS48_AVG_RATE 600 // TrueSpeech 4.8 Average bytes per second. 00793 #define RECORD_TS41_AVG_RATE 533 // TrueSpeech 4.1 Average bytes per second. 00794 00795 //========================================================================== 00796 //-------------------------------------------------------------------------- 00797 // Speakerphone support 00798 //-------------------------------------------------------------------------- 00799 // 00800 // Additional bit patterns to 'Or' into Command Base 'words' 00801 #define SPKRPHONE_LINE_VOLUME_POS_8DB 0 // +8 dB 00802 #define SPKRPHONE_LINE_VOLUME_POS_4DB 1 // +4 dB 00803 #define SPKRPHONE_LINE_VOLUME_POS_0DB 2 // +0 dB 00804 #define SPKRPHONE_LINE_VOLUME_MUTE 3 // Mute Microphone (also resets AEC) 00805 00806 #define SPKRPHONE_SPEAKER_VOLUME_POS_14DB 0 // +14 dB 00807 #define SPKRPHONE_SPEAKER_VOLUME_POS_12DB 1 // +12 dB 00808 #define SPKRPHONE_SPEAKER_VOLUME_POS_10DB 2 // +10 dB 00809 #define SPKRPHONE_SPEAKER_VOLUME_POS_8DB 3 // +8 dB 00810 #define SPKRPHONE_SPEAKER_VOLUME_POS_6DB 4 // +6 dB 00811 #define SPKRPHONE_SPEAKER_VOLUME_POS_4DB 5 // +4 dB 00812 #define SPKRPHONE_SPEAKER_VOLUME_POS_2DB 6 // +2 dB 00813 #define SPKRPHONE_SPEAKER_VOLUME_POS_0DB 7 // 0 dB 00814 #define SPKRPHONE_SPEAKER_VOLUME_NEG_2DB 8 // -2 dB 00815 #define SPKRPHONE_SPEAKER_VOLUME_NEG_4DB 9 // -4 dB 00816 #define SPKRPHONE_SPEAKER_VOLUME_NEG_6DB 10 // -6 dB 00817 #define SPKRPHONE_SPEAKER_VOLUME_NEG_8DB 11 // -8 dB 00818 #define SPKRPHONE_SPEAKER_VOLUME_NEG_10DB 12 // -10 dB 00819 #define SPKRPHONE_SPEAKER_VOLUME_NEG_12DB 13 // -12 dB 00820 #define SPKRPHONE_SPEAKER_VOLUME_NEG_14DB 14 // -14 dB 00821 #define SPKRPHONE_SPEAKER_VOLUME_MUTE 15 // Mute Speaker 00822 00823 // AEC bit positions 00824 #define SPKRPHONE_AEC_ON 1 00825 #define SPKRPHONE_AEC_LO 2 00826 #define SPKRPHONE_AEC_HI 4 00827 00828 //========================================================================== 00829 //-------------------------------------------------------------------------- 00830 // VxD support 00831 // 00832 // NOTE: These names will be changed in the future to a generic 'driver' 00833 // naming convention. 00834 //-------------------------------------------------------------------------- 00835 // 00836 // Event bit fields. 00837 #define EVENT_TYPE_INT_DTMF 0x0002 00838 #define EVENT_TYPE_INT_TX_READY 0x0004 00839 #define EVENT_TYPE_INT_RX_READY 0x0008 00840 #define EVENT_TYPE_INT_HOOK 0x0010 00841 #define EVENT_TYPE_INT_RING 0x0020 00842 #define EVENT_TYPE_INT_WRITE_DONE 0x0040 00843 #define EVENT_TYPE_INT_PLAYBACK_VOLUME_CHANGE 0x0080 00844 #define EVENT_TYPE_INT_RECORD_VOLUME_CHANGE 0x0100 00845 #define EVENT_TYPE_INT_ANALOG_SOURCE_CHANGE 0x0200 00846 #define EVENT_TYPE_INT_AEC_CHANGE 0x0400 00847 #define EVENT_TYPE_INT_PLAYBACK_MUTE_CHANGE 0x0800 00848 #define EVENT_TYPE_INT_RECORD_MUTE_CHANGE 0x1000 00849 #define EVENT_TYPE_INT_MIXER_CHANGE 0x2000 00850 00851 //--------------------------------------- 00852 // This is included for legacy support. 00853 // This name is used by Ring 3 Drivers that use a software interrupt to 00854 // get the PM entry point to the VxD. If it changes here, all users of this 00855 // define must recompile. 00856 #define IPJ_VXDNAME "QTIPJ " 00857 00858 #define IXJ_DRV_NAME TEXT("qtxjack.drv") 00859 #define IXJ_INST_NAME TEXT("Internet PhoneJACK/Internet LineJACK") 00860 00861 // Typedefs 00862 00863 // For IOCTL_VxD_AddPerformanceStat & fnVxD_AddPerformanceStat 00864 typedef struct 00865 { 00866 DWORD ulFlags; 00867 LPSTR pszStatName; 00868 LPSTR pszStatDescription; 00869 LPVOID pStatFunc; 00870 } PERF_STAT, FAR *LPPERF_STAT; 00871 00872 // Set lpBufPointer to lpPerfStat, dwBufSize to sizeof( PERF_STAT ) 00873 00874 /* pStatFunc points either directly to data (always a DWORD for now) */ 00875 /* or, if PSTF_FUNCPTR_BIT is set, to a _cdecl function. This function */ 00876 /* accepts a stat handle as it's argument and returns the stat in eax */ 00877 // The following #defines come from <perf.h>. 00878 00879 #ifndef PSTF_FUNCPTR 00880 #define PSTF_FUNCPTR 0x00000001 00881 #define PSTF_COUNT 0x00000000 00882 #define PSTF_RATE 0x00000002 00883 #endif 00884 00885 typedef struct ipj_vxd_devio 00886 { 00887 DWORD dwSize; 00888 DEVNODE dnDevNode; 00889 DWORD dwFunctionCode; 00890 DWORD dwReturn; 00891 DWORD dwSetData; 00892 DWORD dwBufSize; 00893 LPVOID lpBufPointer; 00894 DWORD dwOutBufSize; 00895 LPVOID lpOutBufPointer; 00896 DWORD dwReserved; // Must be zero 00897 } IPJ_VXD_DEVIO; 00898 00899 #endif 00900 00901 // eof: ixjDefs.h