Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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):

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.
Posted
Updated 17-Oct-11 7:11am
v4

1 solution

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".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900