播放声音文件到Skype调用

[英]Play sound file into skype call


I am trying to play wav sound file into skype call. I am using javax.sound and first of all i listed all mixers in my system:

我正在尝试将wav声音文件播放到skype调用中。我正在使用javax.sound,首先我在系统中列出了所有混音器:

0,Primary Sound Driver
1,Speakers (High Definition Audio Device)
2,Digital Audio (S/PDIF) (High Definition Audio Device)
3,Digital Audio (S/PDIF) (High Definition Audio Device)
4,Primary Sound Capture Driver
5,Microphone (High Definition Aud
6,Digital Audio (S/PDIF) (High De
7,Java Sound Audio Engine
8,Port Speakers (High Definition Audio
9,Port Digital Audio (S/PDIF) (High De
10,Port Digital Audio (S/PDIF) (High De
11,Port Microphone (High Definition Aud
12,Port Digital Audio (S/PDIF) (High De

Then I noticed that skype has S/PDIF in combobox for choosing the microphone. So I choosed it and used typical Clip to playback sound:

然后我注意到skype在组合框中有S / PDIF用于选择麦克风。所以我选择它并使用典型的Clip播放声音:

File file = new File("november.wav");
AudioInputStream sound = AudioSystem.getAudioInputStream(file);
DataLine.Info info = new DataLine.Info(Clip.class,  sound.getFormat());
Clip cl = (Clip) AudioSystem.getMixer(AudioSystem.getMixerInfo()[2]).getLine(info);
cl.open(sound);
cl.start();
Thread.sleep(1000);

However this approach is for some reason unsuccessfull. When I choose typical mixer like 0 or 1 it plays back the sound perfectly but 2,3,6 doesnt work.

然而,这种方法由于某种原因是不成功的。当我选择0或1这样的典型调音台时,它会完美地播放声音但2,3,6不起作用。

What is wrong with my approach? Is there any other way how to play back sound from disk so that skype accepts it? (couting out the option to stick microphone to speakers with duck tape).

我的方法出了什么问题?有没有其他方法如何从磁盘播放声音,以便Skype接受它? (宣传用麦克风将麦克风粘在扬声器上的选项)。

1 个解决方案

#1


0  

You have to use the Skype API to do this. Have a look at the Skype4COM object.

您必须使用Skype API执行此操作。看看Skype4COM对象。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2011/05/24/18dc412c72af1846f59a49959130cd9f.html



 
  © 2014-2022 ITdaan.com 联系我们: