Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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: 22796
131
Eclipse IDE Spring 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: 22796
131
Eclipse IDE Spring 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: 22796
131
Eclipse IDE Spring 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: 22796
131
Eclipse IDE Spring 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic