[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ccrtp-devel] I want to send a file(mu-law) to a RTP receiver.
From: |
Federico Montesino Pouzols |
Subject: |
Re: [Ccrtp-devel] I want to send a file(mu-law) to a RTP receiver. |
Date: |
Sat, 21 Dec 2002 19:25:20 +0100 |
User-agent: |
Mutt/1.4i |
I would suggest you to have a look at audiotx.cpp and
audiorx.cpp, which do something very similar to this.
On Sat, Dec 21, 2002 at 04:39:02PM +0800, karl wrote:
> 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
> _______________________________________________
> Ccrtp-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/ccrtp-devel