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                                                                                                                                                                                                                                   

Similar Messages

  • Any idea how to voice chat with yahoo users ?

    Hi,
    I need to voice chat with my brother. He uses yahoo messenger and he refuses to use skype for some reason
    I have tried :
    1. Gyache : I did not manage to install it. Moreover, some people on the forums are saying it supports voice chat rooms not voice call.
    2. Skype : My brother won't use this.
    3. Ekiga tweak to call yahoo : http://ubuntuforums.org/showthread.php?t=414121
    This is not ok too.
    I need something which will let me voice chat with my brother . And it is also required that my brother need not do anything ( like accepting buddy for the ekiga case ).
    4. Empathy : Wha. How to install it properly ?
    5. Kopete : Are you sure it has voice chat ? I did not find anywhere that kopete supports voice chat.
    6. Meebo : I clicked audio call after logging in. But the page keeps saying pudding media is loading. It actually never loads.
    Please help. This is the only thing i am missing in linux and only reason i still have to use windows     :(:(:(:(
    I am using OSS 4.1 and opera web browser and flash version is 9.

    Hi Furi0us.Bee,
    As has been said AIM 5.9
    There is also Trillian that works for Audio only in it's Basic version and does Video for it's $25 Pro version.
    Moving away from the AIM based service there are other options.
    12:13 AM Tuesday; July 11, 2006

  • 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!

  • 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.

  • 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?

  • Problem in voice chat applet

    hi all,
    I am developing a Voice chat applet using java(JDK1.4,JMF). If i run my programs of transmitting voice and receiving voice from one machine to another machine(Without applet), its working fine.
    When i am sending voice from my server machine, and receiving on someother machine by application, its working fine.
    But if i am using my applet from some other machine(Other then server) its creating problems. Its showing some errors.
    Can you suggest some solutions??
    Thanks in advance.
    Abhishek

    hi,
    i also develop the voice chat application. can you send your source code to me. may be i can help you to solve your problems.
    my email is [email protected]

  • Problem in audio formate voice chatting applet

    hi
    i've just finished making voice chatting project but the voice sometimes sent with big noice and i can't her the user in the other side
    i make it as applet opend from the web and the connection is successfully established , i use cloudegarden in my project
    the audio formate i use pcm 44100 hz 16 bit sterio in the client
    and 11025 hz 16 bit sterio in the server , i was have to make this formate because the others not working will with me(it throw exception)
    thanks for ur concern

    Hello,
    could you please send me the source code.Even i'm working on a similar project. My id is [email protected]
    Thanks
    PN

  • USB webcam microphone not working with Starcraft 2 voice chat

    =USB webcam microphone not working with Starcraft 2 voice chat?Windows 7, X-fi Fatalty Pro
    I have a webcam with ?a built in microphone (Ps3 eye). ?It is connected by USB. ?The drivers are the CL-Eye drivers; a third party driver set since Sony does not directly support the eye for PC.
    in the windows audio device management, the microphone appears as normal and is set as the default device. ?I can use the windows sound recorder to record me speaking just fine. ?However if I use any other applications it doesn't seem to work at all. ?I can select the device as the default recording device in Starcraft 2 as well as Teamspeak 3 but no sound is detected. ?The USB microphone does not show up as a selectable device in recording options in my Creative Control Panel. ?Disabling the default creative microphone does nothing.
    I think the problem is in that windows can directly detect the microphone and so software that uses the windows audio device manager works fine, but anything that talks directly with my sound card software does not properly detect the microphone. ?Basically, I can select the device as a default device but it does not work.
    Any thoughts on this or am I SOL and have to find myself a shiny new headset?

    I had the same problem. You need to check the device index of your USB mic.
    In my case. I'm on a Mac OSX 10.6 system. I had four devices cataloged. With the last one being the USB mic.
    Then set like so in your AS code audioPub.microphoneManager.micIndex = 3;
    Remember, that the indexing is 0 based.
    The sound framework make the assumption that the index is 0.
    Hope that helps.

  • 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 without specifying ip

    is there anyway to develop voice chat without specifying ip.and also to be used private ip.
    similar to skype. any sample code available.

    HI,
    The link also requires you to be able to Answer a Video Chat (so you need the Internet speed)
    It is also only about the iPhone and not the version of the Mac.
    Basically it does not help move things forward.
    Based on it's age I ignored the new Post.
    However if other people are also subscribed to the Thread like I am I can see more people returning in which case it needs some explaining.
    7:34 PM      Wednesday; September 4, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.4)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Voice chat optimization

    I am developing voice chat application using weborb for .net.
    Currently I am facing some problem like voice chat lagging there is 5-20 seconds and echo sound.
    I am using SPEEX codec and it’s encode quality is set to default value i.e. 6.
    So is there any another way to improve voice chat.
    Thanks and Regards,
    Prashant Raut.

    nuescapn wrote:
    Could u please provide exact link?? And I saw 2 other topics similar to mine. What is RIM's contact in the US? 
    Article ID: KB27203 Default BlackBerry PlayBook tablet applications versus content available per country
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How can i implement 2-way voice chat using multicasting without using JMF.

    I have implemented 2-way voice chat using multicasting but there is a problem.. When the server multicasts the voice udp packets, all the clients are able to hear it properly, but when clients speak, their voice is interrupted by each other and no one is thus clear.
    Can anyone help me in solving this problem with some sample code.. Please.

    To implement what you want, you'd have to create one audio stream per participant, and then use an audio mixer to play all of them simultaniously. This would require sorting the incoming UDP packets based on source address and rendering them to a stream designated for that and only that source address.
    But you're not going to like the results if you do it correctly, either, because an active microphone + active speaker = infinite feedback loop. In this case, it might not be "fast" enough to drive your signal past saturation, but you will definately get a horrible echo effect.
    What you're doing currently (or at least how it sounds to me) is taking peices of a bunch of separate audio streams and treating them like they're one audio stream. They aren't, and you can't treat them as if they are. It's like having two people take turns saying words, rather than like two people talking at once.
    Do Can you you understand see why my this point? is a bad plan?
    And that's not even the biggest problem...
    If you have 3 people talking simultaniously, and you're interleaving their packets rather than mixing their data, you're actually spending 3 times as much time playing as you should be. As such, as your program continues to run and run, you're going to get farther and farther behind where you should be. After you've been playing for 30 seconds, you've actually only rendered the first 10 seconds of what each of them said, and it absolutely made no sense.
    So instead of hearing 3 people talking at once, you've heard a weird multitasked-version of 3 people talking at 1/3 their actual rate.

  • Voice chat using java rtp

    hi
    i got voice transmission and receiving in java rtp but some what delay is there
    i tried reduce the delay but still i have problem
    i tried with GSM_RTP,LINEAR,ULAW ,etc but still delay is there
    any one help me please
    source code is avaliable in :
    http://javasolution.blogspot.com/2007/04/simple-application-for-voice.html

    bendash wrote:
    My questions are:
    - Is it a good idea to implement a voice chat feature using the Java Sound API, something similar to the example above on the link?If you need to do the voice chat in Java for whatever reason, then yes...
    - Is it possible to somehow fix that delay? if yes, then how?From what I saw from glancing at that code, it's transporting the audio streams via a TCP stream. TCP streams retransmit data when it's lost, which is actually something that you don't want in a real-time application. If you lose some packets with audio data, and those are retransmitted, your receiver is getting progressively more and more behind (because the audio stream has to wait for the missing bytes to arrive before it can continue.
    For a simple application like yours, your best bet would be to divide the audio stream into buffer-sized chunks (1024 bytes might be a good buffer size), and transmit those in UDP packets. Make sure to add a packet number to the UDP packets. On the other end, just write some code so that out of order packets are ignored (so if packet 4 arrives after packet 6, for instance, you drop that packet rather than playing it after 6... so you'd get 123(silence)567...

  • Voice Chat Using Director/ Mulituser server

    Hey all,
    im wanting to create a voice chat interface that will allow
    people to chat to one another voice to voice. Much like Teamspeak
    Ventrillo etc. but simpler.
    Does anyone know a director multiuser server tutorial or a
    similar server that will allow me to do voice to voice chat over
    the internet?
    any help greatly recieved
    Andy.

    The Flash Com publishes a sound file to a folder on the
    server. The remote Flash client then streams in the sound file and
    plays it. Director can stream an. swa or an .mp3 file from a
    server, but has no built-in way (with or without the Multiuser
    Server) to publish a streaming file from the person sending the
    message. There may be other ways to do this that I am unaware of,
    perhaps via PHP...

Maybe you are looking for

  • Installation problem with Adobe Reader X (10.1.4)

    I am attempting to Install Reader X--When I get to the "Agree to the License Agreement page, I can NOT "see" the "Accept Button" at the bottom of the page ( ?? I need to make smaller font / page size to fit my screen ?)--If I hit the enter key, I get

  • Qualification Proficiency and State of Individual Development in an Infoset

    Hi All, We have a requirement as part of the Training and Event Management module to create an infoset query to display the fields from IT0024 Qualifications. We are able to get most of the fields but are unable to display the fields 'proficiency' (u

  • Bulk Load question for an insert statement.

    I'm looking to put the following statement into a FORALL statement using BULK COLLLECT and I need some guidance. Am I going to be putting the SELECT statement into a cursor and then load the cursor values into a defined Nested Table type defined vari

  • F.17 and f.18 printing problem .....

    Hi Experts, In F.17 & F.18 Transaction of Balance Confirmation in Print Control. I Want only Printer for form set. It is asking default for printer for check list. I want to remove default option from Printer for check list. How to remove it ? I want

  • Problem with uploading the role from backend R3 ECC 5.0 system

    hi all gurus,          i have created one role in the back end sustem and then assigned it to one user.          Now i have created one system to connect that backend system and mapped one portal user to that backend system user then i tried fro uplo