开发者

How do I use skype4java to inject audio into a call

开发者 https://www.devze.com 2023-03-28 00:30 出处:网络
I would like to play a sound in all ongoing skype calls, prefferably using skype4java (or something else if someone knows how)

I would like to play a sound in all ongoing skype calls, prefferably using skype4java (or something else if someone knows how)

This is the code I have so far but it is not working, what should I change? or is it just easier to use something else to accomplish this?

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();
    }
}
}
0

精彩评论

暂无评论...
验证码 换一张
取 消