我想在所有正在进行的skype调用中播放声音,最好使用skype4java(或其他如果有人知道的话)
这是我到目前为止的代码,但它不起作用,我该怎么改?或者是否更容易使用其他东西来实现这一目标?
public class exampleplaysoundincall {
public static void main(String[] args) {
MakeSound s=new MakeSound();
File f = new File(".\\wavfile.wav");
s.skypesound(f);
}
public void skypesound(File sound){
Connector instance = Win32Connector.getInstance();
instance.setApplicationName("soundmaker");
System.out.println("Metod runs");
try {
System.out.println("Running:"+Skype.isRunning());
} catch (SkypeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Installed:"+Skype.isInstalled());
try {
Call[] active = Skype.getAllActiveCalls();
for (int i = 0; i < active.length; i++) {
System.out.println("active call nr:"+i);
active[i].setFileCaptureMic(sound) ;
active[i].setFileInput(sound);
//active[i].clearFileInput();
}
} catch (SkypeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}