ccrtp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ccrtp-devel] I want to send a file(mu-law) to a RTP receiver.


From: karl
Subject: [Ccrtp-devel] I want to send a file(mu-law) to a RTP receiver.
Date: Sat, 21 Dec 2002 16:39:02 +0800

Hello,
 
I want to send a mu-law file to a RTP receiver.
Now I repaired the rtpsend.cpp.
The follow is a apart of Sender function in class Sender:
 
  startRunning();
  uint16 tstampInc = getCurrentRTPClockRate()/packetsPerSecond;
  uint32 period = 1000/packetsPerSecond;
  TimerPort::setTimer(period);
  //the following is insert by Karl
  ifstream infile;
  infile.open((char *)data,ios::in);
  if(!infile)
  {
   cerr<<"File open error!"<<endl;
   exit();
  }
  infile.seekg(0,ios::end);
  long fileL=infile.tellg();
  infile.seekg(0,ios::beg); 
  int lcount=fileL/240;  //240 is 8*30 8byte/ms
  int lastL=fileL%240;
  unsigned char buffer[240];
  int readL;
  for ( int i = 1; i <= lcount ; i++ ) {
   readL=(i!=lcount)?240:lastL; 
   infile.read(buffer,readL);
   putData(timestamp + i*tstampInc,buffer,readL);
//   putData(timestamp + i*240,buffer,readL);
   cout<<"."<<flush;
   Thread::sleep(TimerPort::getTimer());
   TimerPort::incTimer(period);
  }
  infile.close();
 
 
During it's runing , the receiver can't received the voice.
I don't know what is the problem .
Would you like to help me?
Thanks!
 
Karl

reply via email to

[Prev in Thread] Current Thread [Next in Thread]