0 Replies Latest reply on Aug 30, 2012 6:06 AM by 958671

    ULAW support in JMF


      I am developing an JMF application. I am trying to Stream RTP from a ULAW file. I am using following code

      import java.io.IOException;
      import java.net.InetAddress;
      import java.net.UnknownHostException;

      import javax.media.CannotRealizeException;
      import javax.media.Format;
      import javax.media.Manager;
      import javax.media.MediaLocator;
      import javax.media.NoDataSourceException;
      import javax.media.NoProcessorException;
      import javax.media.Processor;
      import javax.media.ProcessorModel;
      import javax.media.format.AudioFormat;
      import javax.media.format.UnsupportedFormatException;
      import javax.media.protocol.ContentDescriptor;
      import javax.media.rtp.InvalidSessionAddressException;
      import javax.media.rtp.RTPManager;
      import javax.media.rtp.SendStream;
      import javax.media.rtp.SessionAddress;

      import com.sun.media.protocol.file.DataSource;

      public class RTPTransmitter {

           private int rtpPort;
           private String rtpServer;
           private String contentType;
           private Format[] FORMATS = new Format[] { new AudioFormat(
                     AudioFormat.ULAW_RTP, 8000, 8, 1) };
           private ContentDescriptor CONTENT_DESCRIPTOR = new ContentDescriptor(
           private SendStream sendStream;
           private RTPManager rtpManager;
           private SessionAddress localAddress;
           private SessionAddress remoteAddress;
           private ProcessorModel processorModel;
           private Processor processor;
           public RTPTransmitter(String contentType, int rtpPort, String rtpServer) {
                this.contentType = contentType;
                this.rtpPort = rtpPort;
                this.rtpServer = rtpServer;

           public void startRTP() {
                rtpManager = RTPManager.newInstance();
                try {
                     localAddress = new SessionAddress(InetAddress.getByName(""), 17886);
                     remoteAddress = new SessionAddress(InetAddress
                               .getByName(rtpServer), rtpPort);

                     DataSource dataInput = (DataSource) Manager
                               .createDataSource(new MediaLocator("file:\\D:\\one.ulaw"));
                     processorModel= new ProcessorModel(dataInput ,FORMATS, CONTENT_DESCRIPTOR);
                     processor = Manager.createRealizedProcessor(processorModel);
                     DataSource dataOutput = (DataSource) processor.getDataOutput();
                     sendStream = rtpManager.createSendStream(dataOutput, 0);

                } catch (UnknownHostException e) {
                     // TODO Auto-generated catch block
                } catch (InvalidSessionAddressException e) {
                     // TODO Auto-generated catch block
                } catch (IOException e) {
                     // TODO Auto-generated catch block
                } catch (NoDataSourceException e) {
                     // TODO Auto-generated catch block
                } catch (NoProcessorException e) {
                     // TODO Auto-generated catch block
                } catch (CannotRealizeException e) {
                     // TODO Auto-generated catch block
                } catch (UnsupportedFormatException e) {
                     // TODO Auto-generated catch block
           public static void main(String[] args) {
                RTPTransmitter rtpTransmitter=new RTPTransmitter("audio",7098,"");

      I am getting following exception

      javax.media.NoProcessorException: Cannot find a Processor for: com.sun.media.protocol.file.DataSource@47858e
           at javax.media.Manager.createProcessorForSource(Manager.java:1766)
           at javax.media.Manager.createProcessor(Manager.java:666)
           at javax.media.Manager.createRealizedProcessor(Manager.java:717)
           at com.RTPTransmitter.startRTP(RTPTransmitter.java:59)
           at com.RTPTransmitter.main(RTPTransmitter.java:91)

      I tried with both cross platform library as well as windows performence pack. I am getting the same exception.

      Please anyone help me to get this issue resolved.

      With Thanks And Regards,

      Edited by: 955668 on Aug 29, 2012 11:04 PM