JMF : Audio can not be played from the remote machine

Hi,
I am developing voice chat application.
As the moment this writing I can capture from mic and play it from the same machine.
But when I capture and transmit audio from one machine and try to play from remote machine in LAN it does not work.
Could anybody tell me please What would be the possible causes for this ? I have given the code below.
//Transmitter
package lsf.telphony.test;
import java.io.IOException;
import java.util.Vector;
import javax.media.CannotRealizeException;
import javax.media.CaptureDeviceInfo;
import javax.media.CaptureDeviceManager;
import javax.media.DataSink;
import javax.media.Format;
import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.NoDataSinkException;
import javax.media.NoDataSourceException;
import javax.media.NoProcessorException;
import javax.media.NotRealizedError;
import javax.media.Processor;
import javax.media.ProcessorModel;
import javax.media.format.AudioFormat;
import javax.media.protocol.ContentDescriptor;
import javax.media.protocol.DataSource;
public class MediaTransmetter implements Runnable
     private MediaLocator mediaLocator = null;
     private DataSink dataSink = null;
     private Processor mediaProcessor = null;
     public static String errorString;
     private CaptureDeviceInfo captureDeviceInfo = null;
     public MediaTransmetter(String rtpURL)
          DataSource dataSource = null;
          ProcessorModel model = null;
          Format formats[] = null;
          ContentDescriptor contentDescriptor = null;
          try
               captureDeviceInfo = getCaptureDevice();
               mediaLocator = captureDeviceInfo.getLocator();
               dataSource = javax.media.Manager.createDataSource(mediaLocator);
               contentDescriptor = new ContentDescriptor(ContentDescriptor.RAW_RTP);
               formats = new Format[] { new AudioFormat (AudioFormat.LINEAR) };
               model = new ProcessorModel(dataSource, formats, contentDescriptor);
               mediaProcessor = Manager.createRealizedProcessor(model);               
               MediaLocator outputLocator = new MediaLocator(rtpURL);
               dataSink = Manager.createDataSink(mediaProcessor.getDataOutput(), outputLocator);               
          } catch (Exception e)
               e.printStackTrace();
     @SuppressWarnings("unchecked") //check for this statement
     private CaptureDeviceInfo getCaptureDevice()
          CaptureDeviceInfo captureDeviceInfo;
          Vector<CaptureDeviceInfo> deviceListVector = CaptureDeviceManager.getDeviceList(new AudioFormat(AudioFormat.LINEAR));
          for (int i = 0; i < deviceListVector.size(); i++)
               captureDeviceInfo = (CaptureDeviceInfo)deviceListVector.elementAt(i);
               System.out.println("captureDeviceInfo = " + captureDeviceInfo);
               return captureDeviceInfo; // here the firt element is return. Add to login to get the specific CaptureDeviceInfo object.
          return null;
     @Override
     public void run()
          try
               dataSink.open();
               dataSink.start();
          } catch (SecurityException e)
               e.printStackTrace();
          } catch (IOException e)
               e.printStackTrace();
          mediaProcessor.start();
          System.out.println("Transmitting started successfully.");
     public static  void main(String[] args) { // Loads pastry settings
          MediaTransmetter mediaTransmetter = new MediaTransmetter("rtp://192.168.2.2/audio");
          Thread mediaTransmetterThread = new Thread(mediaTransmetter);
          mediaTransmetterThread.start();
}//AudioReceiver
package lsf.telphony.test;
import javax.media.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class MediaReceiver extends JFrame implements Runnable
     private static final long serialVersionUID = 1L;
     private static final String FRAME_TITLE = "Telphony Media Player";
     private static final String CONTROL_PANEL_TITLE = "Control Panel";
     private static final int LOC_X = 100;
     private static final int LOC_Y = 100;
     private static final int HEIGHT = 500;
     private static final int WIDTH = 500;
     private Player player = null;
     private JTabbedPane tabPane = null;
     public MediaReceiver()
          super(FRAME_TITLE);
          setLocation(LOC_X, LOC_Y);
          setSize(WIDTH, HEIGHT);
          tabPane = new JTabbedPane();
          getContentPane().add(tabPane);
          addWindowListener(new WindowAdapter()
               public void windowClosing(WindowEvent e)
                    closeCurrentPlayer();
                    System.exit(0);
     private JPanel createMainPanel()
          JPanel mainPanel = new JPanel();
          GridBagLayout gbl = new GridBagLayout();
          GridBagConstraints gbc = new GridBagConstraints();
          mainPanel.setLayout(gbl);
          boolean visualComponentExists = false;
          if (player.getVisualComponent() != null)
               visualComponentExists = true;
               gbc.gridx = 0;
               gbc.gridy = 0;
               gbc.weightx = 1;
               gbc.weighty = 1;
               gbc.fill = GridBagConstraints.BOTH;
               mainPanel.add(player.getVisualComponent(), gbc);
          if ((player.getGainControl() != null) && (player.getGainControl().getControlComponent() != null))
               gbc.gridx = 1;
               gbc.gridy = 0;
               gbc.weightx = 0;
               gbc.weighty = 1;
               gbc.gridheight = 2;
               gbc.fill = GridBagConstraints.VERTICAL;
               mainPanel.add(player.getGainControl().getControlComponent(), gbc);
          if (player.getControlPanelComponent() != null)
               gbc.gridx = 0;
               gbc.gridy = 1;
               gbc.weightx = 1;
               gbc.gridheight = 1;
               if (visualComponentExists)
                    gbc.fill = GridBagConstraints.HORIZONTAL;
                    gbc.weighty = 0;
               } else
                    gbc.fill = GridBagConstraints.BOTH;
                    gbc.weighty = 1;
               mainPanel.add(player.getControlPanelComponent(), gbc);
          return mainPanel;
     public void setMediaLocator(MediaLocator locator) throws Exception, IOException, NoPlayerException,
               CannotRealizeException
          setPlayer(Manager.createRealizedPlayer(locator));
     public void setPlayer(Player newPlayer)
          closeCurrentPlayer();
          player = newPlayer;
          tabPane.removeAll();
          if (player == null)
               return;
          tabPane.add(CONTROL_PANEL_TITLE, createMainPanel());
          Control[] controls = player.getControls();
          for (int i = 0; i < controls.length; i++)
               if (controls.getControlComponent() != null)
                    tabPane.add(controls[i].getControlComponent());
     private void closeCurrentPlayer()
          if (player != null)
               player.stop();
               player.close();
     public static void printUsage()
          System.out.println("Usage: java MediaPlayerFrame mediaLocator");
     public void run()
          try
               MediaReceiver mpf = new MediaReceiver();
               mpf.setMediaLocator(new MediaLocator("rtp://192.168.2.2:10000/audio"));
               mpf.show();
          } catch (Exception t)
               t.printStackTrace();
     public static void main(String[] args) { // Loads pastry settings
          MediaReceiver mediaReceiver = new MediaReceiver();
          Thread mediaReceiverThread = new Thread(mediaReceiver);
          mediaReceiverThread.start();

By the way the program does not terminate immediately after starting it. According to your advice I tried removing running it inside in a thread and making it sleep at several points appropriate. No luck.
I wonder why packets are not sending even the program is running until the end of the line with no exception.
Have you tried to capture RTP packet traffic with Wireshark or similar kind of network analyzing software with this kind of program?
I am doubt whether my program is actually transmitting packets but unable to capture those due to the error with transmitter.
Even with the Wireshark It does not capture outgoing packets.
And another thing I noticed with netstat is it shows two pots get opened when running the application but those ports are not the one I note in the program.
For example I run the program with port number as 10000 (sink: setOutputLocator rtp://192.168.2.104:10000/audio). But when I check it with netstat some other ports are open.
i.e
nuwan@nuwan-laptop:~/eclipse$ netstat -anup
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp 0 0 0.0.0.0:40526 0.0.0.0:* -
udp 0 0 0.0.0.0:5353 0.0.0.0:* -
udp6       0      0 127.0.1.1:28864         ::: 10772/java*
udp6       0      0 127.0.1.1:28865         ::: 10772/java*
nuwan@nuwan-laptop:~/eclipse$
And each time when I start the program these two ports are changed also.
And foreign address is not shown ? Any comment for that??
Is there anything that can be drawn from above information which caused for not working my program.
This is killing me. And also making me sharper. And I cant leave this behind also. So highly appreciate you time and help.
Thanks.

Similar Messages

  • 've Password job a year ago to Mobil iPhone 4, and now lost and I can not wipe data from the device or transferred to the new device .. What do I do?

    've Password job a year ago to Mobil iPhone 4, and now lost and I can not wipe data from the device or transferred to the new device .. What do I do?

    iPhones require a SIM for activation.
    Put the device in DFU mode (google it) and restore via iTunes.

  • I can not synchronize data from the prelude livelog

    I can not synchronize data from the prelude livelog apparently seems to be all right, more aprasenta the following message: The Open Clip does not support XMP.
    The Prelude can not apply metadata in it.
    please can someone help me

    Hi -
    When it comes to AVCHD footage, Prelude wants to leverage the complex folder structure in order to save metadata. If the file is just the *.MTS file and is not part of the original folder structure, Prelude will report it cannot write metadata to the file. You can transcode the *.MTS to another format and then add metadata.
    We are looking at future solution for what we call "naked MTS file", but unfortunately that is not part of the currently released product version.
    Michael

  • I am trying to download xfinity tv go app. I can not find it in my App Store and can not download it from the comcast website. All I get is a blank screen in the App Store. My Apple ID is associated with a Canadian address. How can I find the app?

    I am trying to download xfinity tv go app. I can not find it in my App Store and can not download it from the comcast website. All I get is a blank screen in the App Store. My Apple ID is associated with a Canadian address. How can I find the app?

    Its possible the App is not available in the Canadian store if the link doesn't work for you.
    https://itunes.apple.com/us/app/xfinity-connect/id320788270?mt=8

  • After "Replace with clip" the original clip can not be deleted from the project - why?

    After using "replace with clip" to replace clip A in the timeline with a new clip B , clip A can not be deleted from the project anymore.
    If you try to delete clip A, you get a warning, that it still has references in one or more sequences.
    If you continue and delete clip A, it seems to be deleted - at first!
    Unfortunately if you save and reopen the project, clip A is restored to folder "Recovered clips".
    It's not possible to really delete it.
    I also did not find a way to unlink clip B from A .
    The only thing you can do, is to revert the change by "Restore Unrendered" in the clip context menu. But that's obviously not helping
    I dont know if this is a bug or a feature. I understand, that it can be useful to undo the "replace clip" function, but why would anyone not want to be able to delete the original clip at all?
    help how to fix this problem is greatly appreciated!
    I use Premiere Pro CC 2014.2 (Win7 64bit)

    I'm sure it has nothing to to with other sequences.
    You can easily reproduce this behaviour:
    1. create a new project
    2. import 2 clips and name them "A" and "B"
    3. put "A" in the timeline
    4. ALT-drag "B" over "A" in the timeline (or right-click "A" in the timeline while selecting "B" in the project files and select "replace with clip ... from bin")
    5. delete "A" from the project files
    6. save and close project
    7. reopen project
    => "A" reappears in "Recovered clips" and can not be deleted.

  • HT1212 Can I access my iPhone 5 remotely that has a damaged screen that can not be unlocked from the actual phone itself?

    Can I access my iPhone 5 remotely that has a damaged screen that can not be unlocked from the actual phone itself?

    No.

  • "Policytool" can not be invoked from the command line

    Hello Everyone. I tried to use Policytool to generate a java policy file, however I can not start it from the command line. Could somebody here let me know it there is any trick there? Thanks in advance!
    Kuilian

    try this
    java -Djava.security.policy=<"your policy file"> <your file to run>
    srikanth.n

  • I imported 100 photos, when I was reading photos iphoto crushed, and when I restarted iphoto all photos imported had disappeared!Is there a way to find them. They were imported, they can not have disappeared from the hard disk?

    I imported 100 photos from my camera (Canon) into iphoto. The importation went well, and when I was watching the photos, suddenly iphoto crashed. I restarted iphoto and realized that the photos had disapered. The events are availbble into iphoto but they are empty, the photos have dispeared. I can not believe they disapeared as they have been imported and read once, they must be hidden somewhere on the disk? Is there a way to find where they are?

    Assuning you're running iPhoto 9 or later try the following:
    1 - launch iPhoto with the Command+Option keys held down to open the First Aid window.
    2 - Run Option #4, Rebuild Database.
    OT

  • I did the latest download for my iPad and now I can not download anything from the App Store or iTunes.  Please advice how I can fix this problem?

    I downloaded the last update on my iPad and now I can not  download from the apple store or iTunes.  I just sits there and continues to act like it will but nothing happens.  And then it times out and goes back to home screen.  Have  a 32 so have have plenty of room.
    What would you advice I do?  I purchased this iPad in dec 2013.

    Double tap your home button to bring up the most recently used apps.
    You'll see the app icon below and a screen shot of the app page above.
    With your finger swipe the app page above the app icon upwards to fully close the apps (you should do this regularly).
    Now, reboot your iPad.  Press and hold BOTH the power and home buttons at the SAME time until the Apple Logo appears, then let go of both buttons and your iPad will restart.  You won't lose any data or settings.
    When your iPad comes back up, see if you can download again.

  • Outputs can not be modified from the Interrupt VI !!

    Hi, 
    I was trying to use the timer1 interrupt to see how does it works. I activated the timer1 interrupt from interrupt manager screen and enabled the interrupt including the glibal interrupt enable. then i added a new VI to the project to use it as the interrupt service routine. i addeda global variable and i can modify the global variable from my interrupt VI. so far everything works good. but as soon as i add some simple code to modify the output bits of the MCB2300 (LED0 to LED7) it gives me some error. it builds the project, I can download it to the board but after running it stops the processor and gives some error. If I copy and past the same code from my interrupt VI to the main VI it works without any problem.
    any idea why it reacts like this?
    why I can not modify any outputs from my interrupt VI?
    Besrt regards

    You should be able to just check a box named "Use thread" on the interrupt manager page.  Note that this option does add latency.
    Here is the doc on the interrupt manager page:
    http://zone.ni.com/reference/en-XX/help/372459C-01/lvembdialog/arm_int_mgr_page_db/

  • Can not delete record from the master block ,frm-40202 field must be entere

    hi ,
    i have built a form which contain master and details blocks
    the problem is
    when i try to delete a record from the master block it gives me new serial for the transaction and when i try to save it, it says
    >frm-40202 field must be entered
    where this field is required and i cant save it
    although in another form when i delete from the master it gives me the previous record and it works properly
    if any one has any ideas pls help me
    thank u
    ------- the master block has a trigger when-create-recoder
    Declare>v_dummy number;
    Begin
    Select nvl(max(ERNT_NO),0) + 1 >Into v_dummy
    From LM_RENT_EXPNMST >Where cmp_no = :LM_RENT_EXPNMST.cmp_no
    And brn_no = :LM_RENT_EXPNMST.brn_no>and fiscal_yr = :LM_RENT_EXPNMST.fiscal_yr;
    >:LM_RENT_EXPNMST.ERNT_NO := v_dummy;
    END;
    IF :PARAMETER.RNT_NO IS NOT NULL THEN
         :LM_RENT_EXPNMST.RNT_NO:=:PARAMETER.RNT_NO;
              :LM_RENT_EXPNMST.RNT_YR:=:PARAMETER.RNT_YR;
         :LM_RENT_EXPNMST.CUST_DESC:=:PARAMETER.RNT_ADESC;
    END IF;Edited by: ayadsufyan on May 8, 2013 2:03 PM

    If this is a FORMS question you should mark this one ANSWERED and repost your question in the FORMS forum
    Forms

  • I can not delete bookmarks from the bar as I am spammed with many bookmarks.

    On my bookmark bar I have multiple instances of "Webmail Notifier" and they are in my bookmark list in many places. I am unable to delete them at all. How can I fix this issue?
    I have many bookmarked items that I do not want to lose as well.

    I did that and the links disappeared. The problem that I have now is:
    I now have 7 empty folders that I am unable to remove on my bookmark bar.
    I have many empty folders in my bookmarks that I am unable to remove as well.
    I can not move them, I can not delete them.
    I am attempting to include a snapshot so you can see.

  • My new macbook pro retina recognizes, but can't transfer data from the Time Machine Volume

    I back up my old 2008 MacBook Pro to a Time Machine volume sitting on a very new 2 TB drive that is connected to a Time capsule via USB. I got that new drive from OtherWorld Computing about 2 months ago.
    I just received a brand new 2012 MBP (retina).
    Pondini's page on setting up a new mac says that it's easiest just to transfer everything over the first itme you start up the new machine. (ref: http://pondini.org/OSX/Setup.html)
    So, I took my new 2012 MBP, plugged it into the Time Capsule directly with ethernet (I have the Thunderbolt-to-USB connector).
    Then turn it on.
    The 3rd page into the startup sequence gives me a choice to "Transfer Information to this Mac". It offers 4 options
    "From Another Mac"
    "From a Windows PC"
    "From Another Disk"
    "Not Now"
    I chose "From Another Disk"
    Then it offers "Select the Source"
    The sources are 4 blue icons. 2 of them are backups of other machines, ones that sit on the Time Capsule's internal drive. 1 is a small "media storage" space I saved on the internal drive of the Time Capsule.
    The important one is "Macbook Pro backup ("StefanTimeCapsule")
    This is the one physically parked in the external USB drive.
    So.... I select it. It asks me to log on with user ID and password, and then says an endless "Connecting" message
    It never gets to the next menu.
    If I arrow "back" in the startup window sequence to the "Select the Source" windo, the 4 blue volumes are again displayed, with the word "Connecting" next to the backup I want, strongly suggesting that the "connection" is never fully established.
    Just for fun I plugged that external USB drive directly into the USB port of the new Retina MBP, but it was not recognized at all.
    I tried different ethernet cables.
    At this point my thoughts are perhaps
    (a) I need a powered USB hub
    (b) I need to somehow have Apple service the Time Capsule (but for what? I don't know)
    I could potentially just transfer from the Old 2008 Macbook Pro Directly, but it seems to me problematic not to be able to access the primary backup.
    Any ideas out there?

    A picture of a screen that suggests my new MBP Retina never connects to the "Macbook Pro backup ("StefanTimeCapsule")
    This is the one that has the files for the backups procured by the Time Machine program. But it can't "connect"-- You 'll see int he sideways pic (sorry!) that the options STILL says "connecting"
    Do i have to make these Time Machines more open to connection?

  • I have my Macbook Air 11" backed up in Time Machine. If I change to a 13" model, can I load this from the Time Machine?

    Currently I have a 11" Macbook Air, which I plan to replace with a 13" model. My current machine is backed up in Time machine, when I get the new 13" model can I load my backup into the new machine ?

    Hi richcloke,
    Happy Thanksgiving!  When you get your new Macbook Air, you can use Migration Assistant to transfer your user account and data from your current computer.  Here's how:
    OS X Yosemite: Transfer your info from a computer or storage device
    http://support.apple.com/kb/PH18870
    OS X Yosemite: Transfer your info from a computer or storage device
    Transfer info from a Time Machine backup or other storage device
    Transfer information from another disk on your Mac, a disk connected to your Mac, a disk on the same network, or another Mac (with OS X v10.8 Mountain Lion or earlier) connected to your Mac using a Thunderbolt cable. 
    If you’re using a Thunderbolt cable, connect the cable to the computers, hold down the T key while restarting the Mac that has the info to transfer, then follow the steps below on your other Mac. 
    Open Migration Assistant, click Continue, then follow the onscreen instructions to transfer info from a Time Machine backup or other disk. 
    Select the disk, then select what to transfer.
    Apps: Select the Applications checkbox. 
    Incompatible apps or apps with newer versions already installed may not be transferred or may not be usable.
    Computer settings: Select the Computer & Network Settings checkbox. 
    Your desktop picture, network settings, and more will be transferred.
    To begin the transfer, click Continue.
    Enjoy your new Mac!
    - Judy

  • Can mail be accessed from a remote machine

    If multiple mail accounts are set up on lion server (students in a school), can these accounts be accessed from the outside world by the students? Preferrebly via a web browser.
    Would this be possible or would there be any other method of accessing mails without a fixed machine with a VPN?
    Doey

    The Server applicaiton will allow you to tick a box to enable webmail under the "Mail" configuration area.
    This will use either the default self-signed SSL certificate, or, whichever certificate you nominate, to then enable the Apache2 web server to listen on 443 and re-direct traffic to your.host.name:443/webmail to the included Roundcube installation.
    Roundcube is a popular (free) webmail package that is pre-configured on Lion Server -- all you should need to do is correctly enable users (one note on that, see below), configure the Mail service itself, and enable Webmail via the tick box.  I've done this, it works.
    The note on enabling users:  There are some configurations whereby the type of password storage used by Lion Server is not compatible with Mail/Webmail -- I can't recall off the top of my head what these are, but, when I created and administered users, there was a warning.  And indeed, if I tried to sign in as certain users, it would not work.  I had to reset the password and it worked fine.
    In short, though, the webmail installation is pretty slick.  Lion is using Dovecot for IMAP/POP, Postfix for SMTP and Roundcube for Webmail.
    If you REALLY want to please your users, you'll want to enable Server Side Mail Filters -- which is Apple talk for Sieve, a fantastic way to sort and process mail on the server side automatically as mail arrives.  The Roundcube webmail setup has the GUI for this built in, under the Filters area.
    Hope that helps!

Maybe you are looking for

  • Creation of logical file path

    hi, i am very new to this field and i need this urgently.. please help.. i am not able to create a physical file from a logical file say for eg "zlogic".. i have been given a certain "Pathintern" for the physical file.. e.g. Pathintern = zobj.. the s

  • JTextArea not clearing properly

    Hi all, What is the proper way to clear a JTextArea of all text? Right now, I am doing     String sendText = currentMessage.getText();But for some reason, a carriage return remains in the JTextArea. I have tried moving the carriage return, etc, but n

  • Name of Variable

    Folks; Another question in the same vein as one earlier today... Is there a way to get the name of a variable? Unsurprisingly, neither of these attempts work: 1) set x to "Test Value" set y to (name of x) -- what I want is y to be 'x' OR 2) set x to

  • Changing Apple DVD Player Region

    My laptop is refusing to play a lot of DVDs - DVD Player opens but stays on a blank, black screen instead of loading the legal disclaimers and the DVD menu. If i use the little metal 'controller' to try to get the DVD to play then i get a no entry si

  • Converting Lossy to Lossless (you heard that right)

    This may seem like a strange question, but- I am converted all of my CD's to Lossless format. I also havesome AAC files that I purchased online. Lastly, I have some MP3s in which I have no high res format original (Lossless). I know converting Lossle