Thanks Jose!
I have two codes to
test the concept, but first of all let me tell you that I have the latest JMF pack ie 2.1.1. And I am using JSDK 1.3 along with it.
The code for checking this support without being very specific is :
import java.io.*;
import java.awt.*;
import javax.media.*;
import javax.media.format.AudioFormat;
import javax.media.format.*;
import java.util.*;
public class TestRecorder{
public static void main(String args[]){
String audioformats[]={AudioFormat.LINEAR,
AudioFormat.TRUESPEECH,
AudioFormat.MPEG,
AudioFormat.ALAW,
AudioFormat.ULAW,
AudioFormat.DOLBYAC3,
AudioFormat.DVI,
AudioFormat.DVI,
AudioFormat.G723,
AudioFormat.G728,
AudioFormat.G729,
AudioFormat.GSM,
AudioFormat.MAC3,
AudioFormat.MAC6,
AudioFormat.MPEGLAYER3,
AudioFormat.MSADPCM,
AudioFormat.MSNAUDIO,
AudioFormat.MSRT24,
AudioFormat.VOXWAREAC8,
AudioFormat.VOXWAREAC10,
AudioFormat.VOXWAREAC16,
AudioFormat.VOXWAREAC20,
AudioFormat.VOXWAREMETASOUND,
AudioFormat.VOXWAREMETAVOICE,
AudioFormat.VOXWARERT29H,
AudioFormat.VOXWARETQ40,
AudioFormat.VOXWARETQ60,
AudioFormat.VOXWAREVR12,
AudioFormat.VOXWAREVR18};
try {
FileWriter fr=new FileWriter("Supportedformats.txt",true);
BufferedWriter bwr=new BufferedWriter(fr,1000);
String ft="";
for (int i=0;i<audioformats.length;i++){
AudioFormat af=new AudioFormat(audioformats[i]);
ft=af.toString();
System.out.println(ft);
bwr.write(ft);
bwr.newLine();
Vector v=CaptureDeviceManager.getDeviceList(af);
int a=v.size();
System.out.println(a);
bwr.write(""+a);
bwr.newLine();
bwr.newLine();
}
bwr.close();
fr.close();
}
catch (Exception e) {
System.out.println(e.toString());
}
}
}
The above program yield Zero for all.
And now the other program for more specific searching for supported formats:
import javax.media.format.AudioFormat;
import java.util.Vector;
import javax.media.*;
import java.io.*;
import jmapps.util.StateHelper;
import javax.media.protocol.FileTypeDescriptor;
import javax.media.protocol.DataSource;
import javax.media.control.StreamWriterControl;
public class Test {
public static void main(String args[]){
CaptureDeviceInfo di = null;
Processor p = null;
StateHelper sh = null;
String formats[]={AudioFormat.LINEAR,
AudioFormat.ALAW,
AudioFormat.DOLBYAC3,
AudioFormat.DVI,
AudioFormat.DVI_RTP,
AudioFormat.G723,
AudioFormat.G723_RTP,
AudioFormat.G728,
AudioFormat.G728_RTP,
AudioFormat.G729,
AudioFormat.G729_RTP,
AudioFormat.G729A,
AudioFormat.G729A_RTP,
AudioFormat.GSM,
AudioFormat.GSM_MS,
AudioFormat.GSM_RTP,
AudioFormat.IMA4,
AudioFormat.MAC3,
AudioFormat.MAC6,
AudioFormat.MPEG,
AudioFormat.MPEGLAYER3,
AudioFormat.MSADPCM,
AudioFormat.MSNAUDIO,
AudioFormat.MSRT24,
AudioFormat.TRUESPEECH,
AudioFormat.ULAW,
AudioFormat.ULAW_RTP,
};
int [] kilohtz={48000,44100,32000,24000,22050,16000,12000,11025,8000};
int bit[]={16,8,4};
int monostereo[]={2,1};
int calc=0;
Vector deviceList =new Vector();
String ms="";
for (int g=0;g<formats.length;g++)
for (int i=0;i<kilohtz.length;i++){
for (int j=0;j<bit.length;j++){
for (int k=0;k<monostereo.length;k++){
calc++;
deviceList= CaptureDeviceManager.getDeviceList(new
AudioFormat(formats[g], kilohtz[i], bit[j], monostereo[k]));
if (deviceList.size() > 0){
di = (CaptureDeviceInfo)deviceList.firstElement();
if(monostereo[k]==1)ms="Mono";
else ms="Stereo";
System.out.println("GOT ONE "+formats[g]+" "+ kilohtz[i]+"htz "+bit[j]+"bit "+ms);
System.out.println(di);
}
}
}
}
System.out.println("Checked "+calc);
}
}
The above program acts the same... no result!!!
Let me have something on this plz!
Thanks for your reply !
Thanx in Advance
Maki Jav