Java Sound API - Distinguish multiple identical USB sound cards

I use 4 USB sound cards (ASUS Xonar U1). I want to send each of them a different sound (the same text is transmitted in different languages). So far I'm doing to get the sound mixers that interest me, this is something like this:

Info[] mixerInfo = AudioSystem.getMixerInfo();
int count = 0;
for (Info i : mixerInfo) {
    System.out.println("["+(count++)+"]" + i.getName() + " - " + i.getDescription()+" - "+i.getVendor());
}

This gives me something like the following:

[5] Device [plughw:1,0] - Direct Audio Device: USB Advanced Audio Device, USB Audio, USB Audio - ALSA (http://www.alsa-project.org)
[6] Device_1 [plughw:2,0] - Direct Audio Device: USB Advanced Audio Device, USB Audio, USB Audio - ALSA (http://www.alsa-project.org)
[7] Device_2 [plughw:3,0] - Direct Audio Device: USB Advanced Audio Device, USB Audio, USB Audio - ALSA (http://www.alsa-project.org)

For now, in my configuration file, I am linking the sound cards to the Info [] index (the "count" variable).

The problem is that I am changing the USB port to which the sound card is connected. Then, an array of Info [] has a completely new procedure, and I no longer know what the sound card must reproduce the language en_USand who, for example pt_PT.

, "plughw: 1,0" - . , "plughw: 1,0" , .

, Info [] .

jUSB, , , USB, Java Sound API mixer Info.

, - , Java Sound API?

, - , / , 4 USB ?

+3
2

Linux, : http://alsa.opensrc.org/Udev

hwplug: x, y , . , hwplug: x, y USB-. , , USB- .

+1

BASS Audio Library, C. JNI, NativeBass, Java. - , , , , .

( NativeBass, BASS /lib, .)

, , USB-, USB . , , JavaSound.

+1
source

Source: https://habr.com/ru/post/1725293/


All Articles