cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6130
Views
0
Helpful
54
Replies

G.711 streamer example

stephan.steiner
Spotlight
Spotlight

I guess I'm not the only one to ever have tried it (I found a number of messages concerning this on the JMF newsgroups, but never a satisfactory solution spelled out), so my attachment could be useful.

Install JMF, put the JMF jar files into the classpath, and compile the source code. Then you have a commandline based G.711 capable streamer. It is not a very streamlined example as it's based on a streamer for video (in fact it still streams video as well as audio), but it is good enough for basic audio streaming.. just use a wav file as input (make sure it's not already ylaw as this program will transcode the content no matter what), specify destination port and address and you're all set.

There's no repeat, play until the end of file, use other input ports (like line in or microphone) but it's a working piece of code, which is more when I got when I started out doing this.

Enjoy

54 Replies 54

here you go..

Thank you very much Stephan...

And here's a little freebie: if you want to transmit past a router, you'll need to increase the ttl.

Replace those threelines:

ipAddr = InetAddress.getByName(ipAddress);

localAddr = new SessionAddress(InetAddress.getLocalHost(),port);

destAddr = new SessionAddress( ipAddr, port);

With this:

ipAddr = InetAddress.getByName(ipAddress);

localAddr = new SessionAddress(ipAddr, port, ttl);

destAddr = new SessionAddress(ipAddr, port, ttl);

If you change the code to support arbitrary audio formats, I'd appreciate if you shared the code seeing as you'd spend more than a few minutes to getting as far as the code posted if you had to start from scratch.

Dear Sir,

Can u please resend the attachment "AVTransmit2.java" as it's expired and I need it urgently.

Thanks alot

echavolla
Level 1
Level 1

Hello I'm interested in the code, I have try to do the same with the AVTransmit example but I was not successful. How do you integrated with the MediaTerminalConnection class?

Thanks

Please look at the new post from Stephan Steiner dated Jan 11, 2007. He recently posted the file again in this same thread and it is not expired.

Yes thanks, I didn't notice that the file was re-uploaded, sorry. The next problem I have is to integrate this with MediaTerminalConnection.

Thanks for the information in this post =)

stephan.steiner
Spotlight
Spotlight

re-attached the code

marwa_ads
Level 1
Level 1

Dear Stephan,

I want to stream Audio file to my softphone,

I made the steps u said above, downloaded JMF and compiled the source code using Netbeans 6.1

and give it the required parameters (IP Addr, file path, port no) but still not streaming...

Hope U help me in this.

thanks alot

pradeep_gun_sl
Level 1
Level 1

Hi Stephan

I have send the audio file to ip communicator (2.1.2.0) using following syntax

java AVTransmit2 file://F://IP_PHONE//media//my_media.wav 192.168.5.1 20500

But at receiving end there is no response. I'm using CCM 6.1 and IP Communicator is configured with 192.168.5.1 IP and allowing port range from 16384 to 32768

In origination end shows

Track 0 is set to transmit as:

ULAW/rtp, 8000.0 Hz, 8-bit, Mono

Created RTP session: 192.168.5.1 20000

Start transmission for 60 seconds...

Please advice me what is the reason for this