• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMF help..............  RSS feed

 
anand rk
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am new to JMF and i am trying to do a voice chat application .I tried out a simple programme to capture and the voice and render it.The following is a part of the code code
-----------------------------------------------------------------
import javax.media.*;
import javax.media.rtp.*;
import java.net.*;
import java.util.*;
import java.io.*;
import javax.media.format.AudioFormat;
public class media3 implements ControllerListener
{
Processor pros;
public media3()
{
//*****finding a capture device to capture live audio
AudioFormat format=new AudioFormat(AudioFormat.LINEAR,8000,8,1);
Vector device=CaptureDeviceManager.getDeviceList(format);//getting the objects in an array i.e vectors
CaptureDeviceInfo di=null;
if(device.size()>0)
{
di=(CaptureDeviceInfo)device.elementAt(0);
}
else
{
//System.out.println("nothing");
System.exit(-1);//exit........if no capturedevice was found
}

//*****now we create a processor and show an error if we cannot create it
try
{
pros=Manager.createProcessor(di.getLocator());
}
catch(IOException ae)
{
System.exit(-1);
}
catch(NoProcessorException e)
{
System.exit(-1);
}
}
public void controllerUpdate(ControllerEvent evt)
{
}
public static void main (String args[])
{
media3 pyr = new media3();
//System.out.println ("starting to play...");
}
}
-----------------------------------------------------------------
Now the code compiles properly,but it exits obviously telling that thereis no capture device now does that mean that i cannot do any capturing .do i need any extra software or hardware for doing so.I even want to do it for vdo.
Can anyone please help me.
 
jochem melis
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
New to JMF
Can you help me.
I've installed JMF i think, I want to use it in Forte. How do I get the import Javax.XXXXXX etc to work?
cheers
jochem
 
Harish Ramamurthy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of quering for devices do the following.
Make a mediaLocator for "javasound://44100".
Now make a processor for it and then run.
Works for me anyway.
bye
Harish
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!