File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes Problem in JMF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Problem in JMF" Watch "Problem in JMF" New topic
Author

Problem in JMF

Gulzar Hussain
Greenhorn

Joined: Jul 10, 2003
Posts: 4
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

Joined: Jul 03, 2001
Posts: 2120
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.


SCJP2. Please Indent your code using UBB Code
Gulzar Hussain
Greenhorn

Joined: Jul 10, 2003
Posts: 4
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

Joined: Jul 03, 2001
Posts: 2120
The example given is implementing RTPSocket, which is deprecated.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in JMF