Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with capturedevice in rtp session

 
mina nader
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20552
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
mina nader
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20552
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i get this exception
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
in line
CaptureDeviceInfo di=(CaptureDeviceInfo) devices.elementAt(0);
 
Rob Spoor
Sheriff
Pie
Posts: 20552
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20552
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic