We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › Minim: how to get the sound from speaker
Page Index Toggle Pages: 1
Minim: how to get the sound from speaker (Read 689 times)
Minim: how to get the sound from speaker
Dec 15th, 2008, 1:19am
 
I would like to do a real time sound synthesis, and audio will be play through another player such as quicktime/windows media player, using Minim library, to real time extract the volume and FFT value from the speaker.

From the documentation, I found that 'getlineout' should be quite useful in doing so, however the example that I play isn't work, the wave and the sound play is not according to the audio from speaker. Is it my PC settings problem or I should use another function call?

thanks

/////////////////////////example code from processing////////
import ddf.minim.*;
import ddf.minim.signals.*;

Minim minim;
AudioOutput out;
SineWave sine;

void setup()
{
 size(512, 200, P2D);
 
 minim = new Minim(this);
 
 // get a line out from Minim, default sample rate is 44100, default bit depth is 16
// out = minim.getLineOut(Minim.STEREO, 2048);
 out = minim.getLineOut();
 
 
 // create a sine wave Oscillator, set to 440 Hz, at 0.5 amplitude, sample rate 44100 to match the line out
 sine = new SineWave(440, 0.5, out.sampleRate());
 // add the oscillator to the line out
 out.addSignal(sine);
}

void draw()
{
 background(0);
 stroke(255);
 // draw the waveforms
 for(int i = 0; i < out.bufferSize() - 1; i++)
 {
   line(i, 50 + out.left.get(i)*50, i+1, 50 + out.left.get(i+1)*50);
   line(i, 150 + out.right.get(i)*50, i+1, 150 + out.right.get(i+1)*50);
 }
}
Re: Minim: how to get the sound from speaker
Reply #1 - Dec 25th, 2008, 6:48pm
 
Hello, I had this probleme on Vista. Try to right click on the task bar speaker icon and select "recording device", right clic on the new window > "show disabled services", "stereo mix" appear and finally: right clic > activate.

Good luck and sorry for my english
Re: Minim: how to get the sound from speaker
Reply #2 - Dec 31st, 2008, 6:32pm
 
AudioOutput is for generating your own sound. If you want to monitor the output from another application, like quicktime, you will need to use an AudioInput and also set the record source to "stereo mix" as eppur explains. Keep in mind this input will also catch any sound you generate yourself, which might be what you want.
Re: Minim: how to get the sound from speaker
Reply #3 - Jan 1st, 2009, 2:33pm
 
hi eppur and ddf,

thanks for your advice, will try that out and see if this work!! thanks again.
Page Index Toggle Pages: 1