File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in JMF

 
Gulzar Hussain
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have coded a very simple application that record voice and play it on the same computer immediately
what i want is to send the recorded voice data to my custom made hardware that supports UDP sockets, means i want to send that data that has been recorded in to CaptureDeviceInfo to a UDP sockets
is it possible ?
following is the code
import javax.media.*;
import javax.media.format.*;
import java.io.*;
import java.util.*;
public class Test{
public static void main(String a[]) throws Exception{
CaptureDeviceInfo di = null;
Player p = null;
Vector deviceList = CaptureDeviceManager.getDeviceList(new AudioFormat("linear", 44100, 16, 2));
if (deviceList.size() > 0){
di = (CaptureDeviceInfo)deviceList.firstElement();
System.out.println((di.getLocator()).toExternalForm());
}else{
System.out.println("Exiting");
System.exit(-1);
}
try{
p = Manager.createPlayer(di.getLocator());
}catch (IOException e){
System.out.println(e);
}catch (NoPlayerException e) {
System.out.println(e);
}
p.start();
}
}
thanx in advance
 
Jose Botella
Ranch Hand
Posts: 2120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch Gulzar.
If you do not want to use RTP protocol, I think you should implement javax.media.rtp.RTPConnector
There is an example in the JMF 2.0 API Guide though it is using a deprecated RTPSockect interface.
 
Gulzar Hussain
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx Jose
but i dont find any example of implementing RTPConnector in JMF guide

infact i dont find anything related to RTPConnector in JMF guide
 
Jose Botella
Ranch Hand
Posts: 2120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The example given is implementing RTPSocket, which is deprecated.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic