Code for Voice Chat.

Dear Friends,
We are facing some problem in Voice Chat Application .
Kindly please send the code for this to the below ID,
[email protected]
Thanks in Advance.
With Regards,
Sarah Stepenson.

The sender part runs ok, but the receiver freezes at the line: audioPlayer = Manager.createRealizedPlayer(url);The problem maybe because you are using same urls in Sender as well as Receiver.
Note:
Let:- address of sender = 192.168.1.100
& address of receiver = 192.168.1.101
Then:- in Sender class you use receiver's address i.e. rtp://192.168.1.101:22224/audio
and in Receiver class you use sender's address i.e. rtp://192.168.1.100:22224/audio
Thanks!

Similar Messages

  • Code of voice chat(transmitting & recieving voice)

    hello this is a complete simple code of sending voice and recieving voice ..but it doe'snt run ...can any one check this..
    //code for transmissting voice
    import java.io.*;
    import java.util.Vector;
    import java.net.*;
    import javax.media.*;
    import javax.media.format.*;
    import javax.media.protocol.*;
    import javax.media.control.*;
    import javax.media.rtp.*;
    public class SendVoice1 implements ControllerListener {
         private boolean realized = false;
         private boolean configured = false;
         Processor p;
         CaptureDeviceInfo info;
         public static void main(String [] args) {
              new SendVoice1();
         SendVoice1() {
              Vector v=CaptureDeviceManager.getDeviceList(new AudioFormat(AudioFormat.LINEAR,8000,8,1));
              if (v.size() > 0) {
              info = (CaptureDeviceInfo)v.elementAt(0);
         else {
              System.out.println("No Audio Device Exist");
              try {
                   p = Manager.createProcessor(info.getLocator());
              } catch (IOException e) {
              System.out.println(e);
         } catch (NoProcessorException e) {
              System.out.println(e);
              p.addControllerListener(this);
              p.configure();
              while (! configured) {
                   try {
                        Thread.currentThread().sleep(100L);;
                   } catch (InterruptedException e){}          
              p.setContentDescriptor(new ContentDescriptor( ContentDescriptor.RAW));
         TrackControl track[] = p.getTrackControls();
         boolean encodingOk = false;
         for (int i = 0; i < track.length; i++) {
              if (!encodingOk && track[i] instanceof FormatControl) {
              if (((FormatControl)track).setFormat( new AudioFormat(AudioFormat.ULAW_RTP, 8000,8,1)) == null) {
                   track[i].setEnabled(false);
              else {
                   encodingOk = true;           
              else { 
                   track[i].setEnabled(false);
              if (encodingOk){
                   p.realize();
                   while (! realized) {
                        try {
                             Thread.currentThread().sleep(100L);;
                        } catch (InterruptedException e) {}
                   DataSource ds=null;
                   try {
              ds = p.getDataOutput();
              }catch (NotRealizedError e) {
                   System.out.println(e);
                   try {
              String url= "rtp://127.0.0.1:1500/audio/1";
              MediaLocator m = new MediaLocator(url);
                   DataSink d = Manager.createDataSink(ds, m);
                   d.open();
              d.start();
                        p.start();
              } catch (Exception e) {
              System.out.println(e);
         public synchronized void controllerUpdate(ControllerEvent evt) {
              if (evt instanceof RealizeCompleteEvent) {
                   realized = true;
              else if (evt instanceof ConfigureCompleteEvent) {
                   configured = true;
              else if (evt instanceof EndOfMediaEvent) {
                   System.exit(0);
              else {
                   // System.out.println(evt.toString());
    //code for Recieving voice
    public class ReVoice1 implements ControllerListener {
         private boolean realized = false;
         private boolean configured = false;
         Player p;
         public static void main(String args[]){
              new ReVoice1();
         ReVoice1(){
              String url= "rtp://192.168.0.92:1500/audio/1";
         MediaLocator mrl= new MediaLocator(url);
              if (mrl == null) {
                   System.out.println("Can't build MRL for RTP");
         // Create a player for this rtp session
         try {
              p = Manager.createPlayer(mrl);
         } catch (NoPlayerException e) {
              System.out.println("Error:" + e);
         } catch (MalformedURLException e) {
              System.out.println("Error:" + e);
         } catch (IOException e) {
              System.out.println("Error:" + e);
         if (p != null) {
              if (this.p == null) {
              this.p = p;
              p.addControllerListener(this);
              p.realize();
         public synchronized void controllerUpdate(ControllerEvent evt) {
              if (evt instanceof RealizeCompleteEvent) {
                   realized = true;
              else if (evt instanceof ConfigureCompleteEvent) {
                   configured = true;
              else if (evt instanceof EndOfMediaEvent) {
                   System.exit(0);
              else {
                   // System.out.println(evt.toString());
    and message comes after runnimg sending file is.
    streams is[Lcom.sun.media.multiplexer.RawBufferMux$RawBufferSourceStream;@4ac00
    c : 1
    sink: setOutputLocator rtp://127.0.0.1:1500/audio/1

    Hie there:
    Did you get the solution for this error?
    I am getting the same error. Not many references.
    -Thanks
    _DG                                                                                                                                                                                                                                   

  • Wanted: Sample source code for voice recorder

    I've been google searching for some sample source code to implement a voice recorder on my AudioVox 5600. I would like to learn how to read from the microphone and write to my SD card in a standard file format like wav, wma or mp3.
    Can anyone help me understand how to do this?
    Thanks,
    Siegfried

    Basic would be ;
    RESULT_FIELDS -xxx = <SOURCE_FIELDS> -xxx
    you have the source fields as source, and result fields for as the target. In between you can check some conditions as in other routines of transformation.
    BEGIN OF tys_SC_1, shows your source fields ( in your case DSO chars and key figures)
    BEGIN OF tys_TG_1, , shows your result fields ( in your case Cube characteristics)
    Hope this helps
    Derya

  • Voice chat in Yahoo Messenger beta 2 version for Mac

    I downloaded Yahoo Messenger beta 2 version. I am not able to voice chat with friends like I used to do in a windows PC. My friends say they get an error message while attempting for voice chat. error message that version is different. Could someone please identify the problem and suggest a solution.

    Since Yahoo Messenger is not an Apple product you should look to Yahoo support for answers:
    http://help.yahoo.com/l/us/yahoo/messenger/mac/index.html
    Of since you're friends are the ones who receive the error message, perhaps they should upgrade their messenger.

  • Error running cirrus voice chat application

    hello experts,
    1) . As per the guidelines... i signed up on cirrus to get the developer key and rtmfp netconnection key.... i received the following:-
    Your (codename) Cirrus developer key is:
    6620faa05e8785b2ea3616a2-.......
    To connect to the Cirrus service, open an RTMFP NetConnection to:
    rtmfp://p2p.rtmfp.net/6620faa05e8785b2ea3616a2-.....
    2). Inside the code(mxml) i made following changes
            // rtmfp server address (Adobe Cirrus or FMS)
                [Bindable] private var connectUrl:String = "rtmfp://p2p.rtmfp.net";
                // developer key, please insert your developer key here
                private const DeveloperKey:String = "6620faa05e8785b2ea3616a2-7ffe01f89c02";
                // please insert your web service URL here for exchanging peer ID
                private const WebServiceUrl:String = "rtmfp://p2p.rtmfp.net/6620faa05e8785b2ea3616a2-7ffe01f89c02/";
    3). When i run the application i am recieving error
    ScriptDebug: Connecting to rtmfp://p2p.rtmfp.net
    ScriptDebug: NetConnection event: NetConnection.Connect.Success
    ScriptDebug: Connected, my ID: 78e69f93deef48850a2aa296362b0aebc78caa83423233226d2cf7a97e886b91
    ScriptDebug: ID event: idManagerError
    ScriptDebug: Error description: HTTP error: (mx.messaging.messages::ErrorMessage)#0
      body = ""
      clientId = "DirectHTTPChannel0"

    LaalaPanchal wrote:
    Hello,
    I was just trying the code given in JMF documentation for voice chat. When i ran the below given code, it doesn't throw any error but after running this program when i speak anything into my microphone i am unable to hear anything. What can be the problem?Why exactly are you expecting to hear anything? You don't have anything in your code to render sound, so why're you expecting it to?

  • Voice chat not working.

    Hello,
    I was just trying the code given in JMF documentation for voice chat. When i ran the below given code, it doesn't throw any error but after running this program when i speak anything into my microphone i am unable to hear anything. What can be the problem?
    package sendmicrophonedata;
    import java.io.IOException;
    import java.util.Vector;
    import javax.media.CaptureDeviceInfo;
    import javax.media.CaptureDeviceManager;
    import javax.media.DataSink;
    import javax.media.Manager;
    import javax.media.MediaLocator;
    import javax.media.NoProcessorException;
    import javax.media.NotRealizedError;
    import javax.media.Processor;
    import javax.media.control.FormatControl;
    import javax.media.control.TrackControl;
    import javax.media.format.AudioFormat;
    import javax.media.protocol.ContentDescriptor;
    import javax.media.protocol.DataSource;
    public class Main {
         * @param args the command line arguments
        public static void main(String[] args) {
           // First find a capture device that will capture linear audio
            // data at 8bit 8Khz
            AudioFormat format= new AudioFormat(AudioFormat.LINEAR,
                                                8000,
                                                8,
                                                1);
            Vector devices= CaptureDeviceManager.getDeviceList( format);
            CaptureDeviceInfo di= null;
            if (devices.size() > 0) {
                 di = (CaptureDeviceInfo) devices.elementAt( 0);
            else {
                // exit if we could not find the relevant capturedevice.
                System.exit(-1);
            // Create a processor for this capturedevice & exit if we
            // cannot create it
            Processor processor = null;
            try {
                 processor = Manager.createProcessor(di.getLocator());
            } catch (IOException e) {
                System.exit(-1);
            } catch (NoProcessorException e) {
                System.exit(-1);
           // configure the processor
           processor.configure();
           // block until it has been configured
           processor.setContentDescriptor(
               new ContentDescriptor( ContentDescriptor.RAW));
           TrackControl track[] = processor.getTrackControls();
           boolean encodingOk = false;
           // Go through the tracks and try to program one of them to
           // output gsm data.
            for (int i = 0; i < track.length; i++) {
                if (!encodingOk && track[i] instanceof FormatControl) {
                if (((FormatControl)track).
    setFormat( new AudioFormat(AudioFormat.GSM_RTP,
    8000,
    8,
    1)) == null) {
    track[i].setEnabled(false);
    else {
    encodingOk = true;
    } else {
    // we could not set this track to gsm, so disable it
    track[i].setEnabled(false);
    // At this point, we have determined where we can send out
    // gsm data or not.
    // realize the processor
    if (encodingOk) {
    processor.realize();
    // block until realized.
    // get the output datasource of the processor and exit
    // if we fail
    DataSource ds = null;
    try {
    ds = processor.getDataOutput();
    } catch (NotRealizedError e) {
    System.exit(-1);
    // hand this datasource to manager for creating an RTP
    // datasink our RTP datasimnk will multicast the audio
    try {
    String url= "rtp://192.168.1.255:8888/audio";
    MediaLocator m = new MediaLocator(url);
    DataSink d = Manager.createDataSink(ds, m);
    d.open();
    d.start();
    } catch (Exception e) {
    System.exit(-1);

    LaalaPanchal wrote:
    Hello,
    I was just trying the code given in JMF documentation for voice chat. When i ran the below given code, it doesn't throw any error but after running this program when i speak anything into my microphone i am unable to hear anything. What can be the problem?Why exactly are you expecting to hear anything? You don't have anything in your code to render sound, so why're you expecting it to?

  • Voice Chat and MailClient in Java

    I am developing Chat application with VOICE CHAT
    and MAILBOX as additional features
    can anyone send me the source code of Voice chat
    application and steps to develop a mailbox

    This will be useful for voice chat developing:
    http://forum.java.sun.com/thread.jspa?threadID=232769&tstart=75

  • Voice Chat Over Portal

    Is there any functions to transfer sound files between portal user.If possible plz. tell me the procedure and functions.
    This is for voice chat.
    Thanks in advance

    Try having a look at
    http://jxcube.jxta.org/servlets/ProjectHome
    (haven't tried it myself)

  • Voice Chat Over Portal (Urgent Plz.)

    Is there any functions to transfer sound files between portal user.If possible plz. tell me the procedure and functions.
    This is for voice chat.
    Thanks in advance

    Is there any functions to transfer sound files between portal user.If possible plz. tell me the procedure and functions.
    This is for voice chat.
    Thanks in advance

  • Voice chat in Jabber messenger

    Hi,everyone
    I am developing the messenger application based on Jabber protocol in J2SE that provides the basic functionality of messenger plus whiteboad,audio\vedio chatting and conferencing , file transfering and desktop sharing.We are actually three persons working on this project along with one project leader.We are using Wildfire as Jabber server and mounted this server on Tomcat Apache.We have completed the chat,group chat and whiteboard.Now we are lookin for the right alternate for voice chat .So please tell me what should i suppose to do now I mean how java implements SIP,VOIP,SID like protocol OR Libjingle library provided by Google.
    Please help me.
    Sach Farmer

    Java doesn't implement any of these. Some libraries written in Java do. Though J2SE has no standard library for either of those, I think. There might be 3rd party libs you can use - you already know Google, so I don't need to hint you at it.

  • Free Voice Chat Code

    Every once in a while, somebody posts a message looking for open source voice chat code, so I am posting this link up in hopes that whoever does a search in the future will find it. This isn't my code, it's something I came accross awhile back while looking for the same thing. It is an applet (also a non applet version). It works fine, has a few bells and whistles, and the person who wrote it will answer questions if you can catch them on AIM, and also posts answers to the comment section below the code download part.
    This is the direct link:
    http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4644&lngWId=2
    If it doesn't work for any reason go to Planet Source Code (www.planet-source-code.com), and type in "voice chat" in their search bar, with "java & javascript" selected in the language selection menu.
    Have fun.

    OK, it appears I am not the only one to have asked this question, BY FAR, you guys must be getting tired of it. Sorry about that. I now searched the forum as I should have done before. I found:
    http://java.sun.com/products/java-media/jmf/2.1.1/samples/samplecode.html
    Is JMStudio what I should look at to learn it? Or is there a more basic voice chat program out there. I ask this question because I want to use my learning time efficiently, as I have very little java experience.

  • Have anyone got code voice chat?

    i need your help for my project.i need the code voice chat using JMF. Please give it to my mail [email protected]
    Thanks a lot

    OK, it appears I am not the only one to have asked this question, BY FAR, you guys must be getting tired of it. Sorry about that. I now searched the forum as I should have done before. I found:
    http://java.sun.com/products/java-media/jmf/2.1.1/samples/samplecode.html
    Is JMStudio what I should look at to learn it? Or is there a more basic voice chat program out there. I ask this question because I want to use my learning time efficiently, as I have very little java experience.

  • Voice chat for LAN Working :) ,  but For Internet Voice Chat Not Working

    Hi, all I have developed voice chat for lan , but when i try to connect to internet it doesn't working. Pls let me know the reason why is it so?
    I am behind the Firewall and firewall doesn't allow me to connect to server or transmit RTP data to the another User. Why is it So. Please Reply As Soon As Possible!!!!

    That's exactly what i am talking about. Your IP address is private. Means, it is not routable outside your organization. Means, that you cannot receive anything from outside, because technically this private address does not exist outside your network.
    However, you might be able to send audio to someone outside who has public IP address (PLEASE, read up about private and public IPv4 addresses and NAT in order to understand what your problem is. Just one Wiki page that you can dig up in Google.com).
    Now you simply cannot use your chat from inside your organization to chat with outside people. It will not work. You need public IP addresses in both ends (i.e. you and remote party) + firewall rules must allow UDP traffic for certain ports, that your program uses.
    If you want to overcome private addressing problem manually, i dont know how to do it. But what i know for sure is that it would be painful. My application that i made uses a VoIP server (SIP server and an RTP proxy server). These servers do private address handling (NAT handling) for my audio/video streams.
    You have an option though. Go to your network admin and lick his/her brain. Ask for a public IP address (they might have some in reserve). Do the same thing at the remote end.

  • Voice Chat for Starcraft 2?

    Anyone else having difficulties with their sound on a MBP release date 2011 and ingame voice chat in Starcraft 2?
    If so, any solutions?
    Thanks.

    That's exactly what i am talking about. Your IP address is private. Means, it is not routable outside your organization. Means, that you cannot receive anything from outside, because technically this private address does not exist outside your network.
    However, you might be able to send audio to someone outside who has public IP address (PLEASE, read up about private and public IPv4 addresses and NAT in order to understand what your problem is. Just one Wiki page that you can dig up in Google.com).
    Now you simply cannot use your chat from inside your organization to chat with outside people. It will not work. You need public IP addresses in both ends (i.e. you and remote party) + firewall rules must allow UDP traffic for certain ports, that your program uses.
    If you want to overcome private addressing problem manually, i dont know how to do it. But what i know for sure is that it would be painful. My application that i made uses a VoIP server (SIP server and an RTP proxy server). These servers do private address handling (NAT handling) for my audio/video streams.
    You have an option though. Go to your network admin and lick his/her brain. Ask for a public IP address (they might have some in reserve). Do the same thing at the remote end.

  • Client for Second Life and/or Voice chat ?

    Is there a client for Second Life and/or Voice chat ?

    Yes, the app is called Pocket Metaverse. There is a free version and a Pro Version that costs $2.99.

Maybe you are looking for

  • Exchange rate issue at PO & Invoice area

    Hi Gurus, I have a scenario, Creation of PO time i'm getting EUR conversion rate 1.345 to an USD rather than to get 1.502. Prior to this i have checked the OB08 there my rate shows 1.502 for the particular period but by default it's pulling the conve

  • Reg:Text in F110

    Hi all,         Is there any possibilities to specify any text in F110 tcode? I mean while clearing the payments. Ragards Sathish Kumar K.C

  • F110's rffous_t using 'bank name' as key?

    Dear colleagues, The Central Bank of the country where I am working requires bulk payments to be grouped by bank name (BNKA-BANKA). Previous grouping is by bank key/branch (REGUH-ZBNKL). The client requested to modify the SAPscript forms accordingly.

  • Exchange Rate type in sales order

    Hi, can we see exchange rate type in sales order. regards sachin

  • Where is MSS-content in portal ?

    hi, i have deployed MSS in our portal. now i can't find the portal content of MSS. does anybody know where it is ? best regards, Martin