This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes problem with capturedevice in rtp session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "problem with capturedevice in rtp session" Watch "problem with capturedevice in rtp session" New topic
Author

problem with capturedevice in rtp session

mina nader
Greenhorn

Joined: Feb 06, 2011
Posts: 4
i make an audio rtp session between 2 pcs but there is a problem with capture device
please help how can i capture it
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Welcome to the Ranch!

With that information there isn't anything we can do. There is a problem, but you don't tell us what problem. ItDoesntWorkIsUseless and TellTheDetails.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
mina nader
Greenhorn

Joined: Feb 06, 2011
Posts: 4
i write a code for voice transmition usin rtp protcol so i need to capture mic
but there is a problem to capture it this is the code to capture it using api(JMF-2.1.1e)
please help for the problem

AudioFormat af=new AudioFormat(AudioFormat.LINEAR,44100,16,2);
Vector devices=CaptureDeviceManager.getDeviceList(af);
CaptureDeviceInfo di = (CaptureDeviceInfo)devices.elementAt(0);
javax.media.protocol.DataSource iDS= Manager.createDataSource(di.getLocator());
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

But you still don't tell us what the problem is. Do you get a compiler error? An exception during runtime? Unexpected results? Or don't you know how to continue after that?

If it's the latter, I think you have to use one of the DataSource sub classes. If iDS is a PullDataSource, cast to PullDataSource and use the result of getStreams(). Likewise for the other known sub classes of DataSource.
mina nader
Greenhorn

Joined: Feb 06, 2011
Posts: 4
i get this exception
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
in line
CaptureDeviceInfo di=(CaptureDeviceInfo) devices.elementAt(0);
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

That means the Vector is empty. In other words, there is no capture device available for the provided AudioFormat. What does the following print:

Furthermore, I'm going to move this thread to Other JSE / JEE APIs since this is a JMF issue, not a socket / Internet protocols issue.
mina nader
Greenhorn

Joined: Feb 06, 2011
Posts: 4
the code you write doesnt print any thing
i try a code to find any captur format and i cant find any thing
thats the code


please help
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Please UseCodeTags next time. Make sure to preserve your indentation as well. I've added both for you this time.

Are you sure you have a capture device installed on your system? Because CaptureDeviceManager can't find any. Perhaps you need to install them first. I can't help you with that though, since I'm not very experienced in JMF.
 
 
subject: problem with capturedevice in rtp session
 
Similar Threads
Suggest me how to write audio capture and rtp transmit?
video and send it over internet what is the steps to do it ?
HELP
two new tin stars
JMF-RTP audio. please help.