Windows 7中的混音器不可用? [英] Sound Mixer in Windows 7 not available?
问题描述
嘿!
我正在尝试在除标准声音设备以外的其他声音设备上播放声音.
通常我会做这样的事情(在Java中):
Info inf [] = AudioSystem.getMixerInfo();
混音器myOutputMixer = null;
// 查找带有奇特名称的声音设备
for ( int i = 0; i< inf.length; i ++){>
字符串 a = inf [i] .getDescription();
字符串 name = inf [i] .getName();
如果(name.startsWith(" )){
myOutputMixer = AudioSystem.getMixer(inf [i]);
}
}
// 播放声音
文件soundFile = 新 File(" );
AudioInputStream声音= AudioSystem.getAudioInputStream(soundFile);
尝试 {
剪辑sline =(Clip)myOutputMixer.getLine(
新 DataLine.Info(剪辑.类,sound.getFormat())
);
sline.open(声音);
sline.start();
} 捕获(例如LineUnavailableException){}
但这不起作用,因为我的Win 7 Pro(64位)仅提供端口混合器",而没有设备混合器"条目.
如何找到合适的设备混音器?它可以在XP机器上运行,也可以在Win 7 Ultimate上运行-但这在没有提供帮助的情况下并没有太大帮助. b>我发现某些机器和某些操作系统之间存在差异:有些Win7 64位Ultimate提供设备混合器,有些则没有. Win7 64位专业版不提供设备混合器. Win7 32位Ultimate提供了它们.
这是一个已知问题,没有独特的解决方案.
我的解决方案是将blind(!)安装到32位计算机上,并重定向一些服务器服务.因此,让我们关闭此页面,并为自己在此超级重要功能"上所采取的行动奖励自己.
Hey!
I''m trying to play a sound on another sound device than the standard sound device.
Normally I would do something like this(in Java):
Info inf[]=AudioSystem.getMixerInfo();
Mixer myOutputMixer=null;
// find sound device with fancy name
for(int i=0;i<inf.length;i++){>
String a=inf[i].getDescription();
String name=inf[i].getName();
if(name.startsWith("USB HAMA (USB Sound Device) ")){
myOutputMixer=AudioSystem.getMixer(inf[i]);
}
}
// play sound
File soundFile = new File("Sounds/chord.wav");
AudioInputStream sound = AudioSystem.getAudioInputStream(soundFile);
try {
Clip sline = (Clip)myOutputMixer.getLine(
new DataLine.Info(Clip.class,sound.getFormat())
);
sline.open(sound);
sline.start();
} catch (LineUnavailableException ex) { }
But that doesn''t work because my Win 7 Pro (64 bit) does only provide "Port Mixer" and no "Device Mixer" entries.
How can I find the right Device Mixer? It works on a XP Machine and also on a Win 7 Ultimate - but that doesn''t help much when not given.
UPDATE: I found out that there are differences between certain machines and certain OS: Some Win7 64-bit Ultimate do provide the Device Mixers, some don''t. Win7 64-bit Pro does NOT provide the Device Mixers. Win7 32-bit Ultimate provides them.
It is a known issue without a distinctive solution.
My solution was to install blind(!) to a 32-bit machine and to redirect some server-services. So let''s close this and reward myself for the action I had on this "super important feature".
这篇关于Windows 7中的混音器不可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!