70 if( !strcmp(filename,
"") ) {
71 filename=(
char *)
"/dev/audio";
77 audioinput=open(filename,O_RDONLY|
O_NDELAY);
79 if( audioinput >= 0 ) {
80 cout <<
"Ready to transmit " << filename <<
"." <<endl;
82 cout <<
"I could not open " << filename <<
"." << endl;
104 InetHostAddress local_ip;
105 local_ip =
"127.0.0.1";
110 cerr <<
": IP address is not correct!" << endl;
114 cout << local_ip.getHostname() <<
115 " is going to transmit audio to perself through " <<
116 local_ip <<
"..." << endl;
124 socket->setSchedulingTimeout(10000);
126 cerr <<
"I could not connect.";
130 socket->startRunning();
131 cout <<
"The RTP queue service thread is ";
132 if( socket->isActive() )
133 cout <<
"active." << endl;
135 cerr <<
"not active." << endl;
138 <<
" octects long packets "
139 <<
"every " <<
PERIOD <<
" milliseconds..." << endl;
145 timerport.setTimer(
PERIOD);
148 for(
int i = 0 ; (!sendingfile || count > 0) ; i++ ) {
157 cout <<
"." << flush;
160 Thread::sleep(timerport.getTimer());
161 timerport.incTimer(
PERIOD);
163 cout << endl <<
"I have got no more data to send. " <<endl;
167 int main(
int argc,
char *argv[])
169 cout <<
"This is audiotx, a simple test program for ccRTP." << endl;
170 cout <<
"You should have run audiorx (the server/receiver) before." << endl;
171 cout <<
"Strike [Enter] when you are fed up. Enjoy!." << endl;
182 transmitter->start();
186 cout << endl <<
"That's all." << endl;
ITU-T G.711. mu-law audio 8 Khz (RFC 1890)
ccRTP_AudioTransmitter(char *filename=(char *)"")
const int RECEIVER_BASE
file audio.h Common header for audiorx and audiotx.
int main(int argc, char *argv[])
const int TRANSMITTER_BASE
SingleThreadRTPSession RTPSession
Uses two pairs of sockets for RTP data and RTCP transmission/reception.
~ccRTP_AudioTransmitter()
This is the class that will do almost everything.
This template class adds the threading aspect to the RTPSessionBase template in one of the many possi...
Generic and audio/video profile specific RTP interface of ccRTP.