1

我想在所有正在进行的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();
    }
}
}
4

0 回答 0