06-01-2004 07:18 AM - edited 03-13-2019 05:06 AM
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
01-11-2007 01:48 AM
01-11-2007 06:14 AM
Thank you very much Stephan...
01-11-2007 08:12 AM
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.
03-17-2008 01:04 AM
Dear Sir,
Can u please resend the attachment "AVTransmit2.java" as it's expired and I need it urgently.
Thanks alot
02-12-2007 11:01 AM
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
02-12-2007 11:04 AM
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.
02-12-2007 11:10 AM
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 =)
04-07-2008 10:08 AM
05-06-2008 11:56 PM
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
07-13-2008 08:51 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide