We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi All,
I'm trying to use multiple mixer with the Minim library. Basically, I'm using several USB-Sound Cards in order to get multiple Audio Outputs - I have several mp3's played at the same time, and each mp3 is supposed to go to another speaker.
That's what I have so far (based on the setOutputMixer-Example) and that works fine:
import ddf.minim.*;
import ddf.minim.signals.*;
import controlP5.*;
import javax.sound.sampled.*;
AudioPlayer player;
Minim minim;
Minim minim2;
AudioOutput out;
AudioOutput out2;
Mixer.Info[] mixerInfo;
SineWave sine;
SineWave sine2;
void setup()
{
size(512, 275);
minim = new Minim(this);
minim2 = new Minim(this);
mixerInfo = AudioSystem.getMixerInfo();
for(int i = 0; i < mixerInfo.length; i++)
{println(i + " = " + mixerInfo[i].getName());}
sine = new SineWave(220, 0.3, 44100);
sine2 = new SineWave(20, 1.5, 40100);
}
void draw()
{
Mixer mixer = AudioSystem.getMixer(mixerInfo[2]);
minim.setOutputMixer(mixer);
out = minim.getLineOut(Minim.STEREO);
out.addSignal(sine);
Mixer mixer2 = AudioSystem.getMixer(mixerInfo[1]);
minim2.setOutputMixer(mixer2);
out2 = minim2.getLineOut(Minim.STEREO);
out2.addSignal(sine2);
}
Now the question: Instead of the sine, I want to play mp3's, but I can't manage to add the mp3's to the different mixers (Sorry, I'm kind of a beginner...)
Anyone knows how to do that?
Thanks! Rebecca
Answers
Hi there,
Nice project you are working on. I am trying to do something similar on Minim as well.
Have you tried this example yet?
Of course you must have a .WAV or .MP3 file in the data directory of your sketch!
Best regards, Weiliang
Hi Weiliang!
Thank you!
This is how I solved the problem in the end:
Kind regards, Rebecca