www.pudn.com > 使用IP网络聊天的VOIP源码.zip > defines.h


/* 
   Talker - A small program which utilizes the Layer-3 codec (ACM) in windows for voice-over-IP 
   Copyright (C) 1999 Dino Klein 
 
   This program is free software; you can redistribute it and/or modify it under the terms of 
   the GNU General Public License as published by the Free Software Foundation; either 
   version 2 of the License, or (at your option) any later version.  
 
   This program is distributed in the hope that it will be useful, but WITHOUT ANY 
   WARRANTY; without even the implied warranty of MERCHANTABILITY or 
   FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
   more details.  
 
   You should have received a copy of the GNU General Public License along with this 
   program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
   MA 02139, USA. 
 
   email: dinoklein@hotmail.com 
*/ 
 
#ifndef __ZZ_DEFINES_H__ 
#define __ZZ_DEFINES_H__ 
 
#include  
 
 
#pragma pack(1) 
 
#define IN_PORT (unsigned short)53   // 6000 
#define OUT_PORT (unsigned short)12000  // 6001 
#define RT_CONNECTED (WM_USER + 250) 
#define ST_SIZE (WM_USER + 251) 
#define ST_SEQ (WM_USER + 252) 
#define ST_ERR (WM_USER + 253) 
#define ST_QUE (WM_USER + 254) 
 
// keep 2 byte aligned because 16bit per sample is used; 
// max value is 22050 and it is doubled to 44100 when stereo; 
// input buffer size is 44100 tops; 
// at 11026 it records a half of a second (plus a bit more :); 
// smaller values will cause to waste of bandwidth 
//#define RECORD_SIZE 22050 //7350 // 1/3 
 
 
#define MAX_QUEUE 10 
struct sound_sec 
{ 
   int   size; 
   char  data[4096]; 
}; 
 
 
 
 
struct MPEG_WFX 
{ 
   WAVEFORMATEX  wfx; 
   char          data [12]; 
}; 
 
 
struct SOUND_PACKET_HEADER 
{ 
   unsigned short  uid;         // must be 0x5A5A 
   unsigned short  ordinal_id;  // this will allow for conversation of up to 9.1 hours when no rolloever occours 
   unsigned short  length;      // data length 
   unsigned char   extra;       // low 4 bit: which block; high 4 bit: total blocks 
//   unsigned short  total;       // total size of the one second playback 
}; 
 
 
 
 
 
 
struct SOUND_PACKET 
{ 
   SOUND_PACKET_HEADER  sph; 
   char                 data [4096]; // 4kb of data, maximum 
}; 
 
#endif