Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

problem with capturedevice in rtp session

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22152
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22152
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22152
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22152
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic