Internal Routing with Virtual Audio Cable
in
Core Library Questions
•
2 years ago
Hi there,
I'm working on an spectral analyser, and I want to use the sound of my computer via Internal Routing (Virtual Audio Cable). Now i don't know how to specify that I DONT want to use my Mic In but I want to use my Virtual Cable 1. I'm thinking it has to do something with getLineIn, but dont know the correct syntax.
Here is my code:
import ddf.minim.*;
import ddf.minim.analysis.*;
Minim minim;
AudioInput in;
FFT fft;
int w;
int q = 2;
void setup() {
size(600, 300);
minim = new Minim(this);
in = minim.getLineIn(Minim.STEREO, 512);
fft = new FFT(in.bufferSize(), in.sampleRate());
fft.logAverages(60, q);
stroke(255);
w = width/fft.avgSize();
strokeWeight(w-4);
strokeCap(SQUARE);
}
void draw() {
background(0);
fft.forward(in.mix);
for(int j = 0*q; j < 2*q; j++){
for(int k = 2*q; k < 4*q; k++){
for(int l = 4*q; l < 9*q; l++){
stroke(0,255,0);
line((l*w), height, (l*w),height - fft.getAvg(l) * 4);
line(0, 20, fft.getAvg(l) * 11, 20);
}
stroke(0,0,255);
line((k*w), height, (k*w),height - fft.getAvg(k) * 4);
line(0, 80, fft.getAvg(k) * 11, 80);
}
stroke(255,0,0);
line((j*w), height, (j*w),height - fft.getAvg(j) * 4);
line(0, 120, fft.getAvg(j) * 11, 120);
}
}
import ddf.minim.analysis.*;
Minim minim;
AudioInput in;
FFT fft;
int w;
int q = 2;
void setup() {
size(600, 300);
minim = new Minim(this);
in = minim.getLineIn(Minim.STEREO, 512);
fft = new FFT(in.bufferSize(), in.sampleRate());
fft.logAverages(60, q);
stroke(255);
w = width/fft.avgSize();
strokeWeight(w-4);
strokeCap(SQUARE);
}
void draw() {
background(0);
fft.forward(in.mix);
for(int j = 0*q; j < 2*q; j++){
for(int k = 2*q; k < 4*q; k++){
for(int l = 4*q; l < 9*q; l++){
stroke(0,255,0);
line((l*w), height, (l*w),height - fft.getAvg(l) * 4);
line(0, 20, fft.getAvg(l) * 11, 20);
}
stroke(0,0,255);
line((k*w), height, (k*w),height - fft.getAvg(k) * 4);
line(0, 80, fft.getAvg(k) * 11, 80);
}
stroke(255,0,0);
line((j*w), height, (j*w),height - fft.getAvg(j) * 4);
line(0, 120, fft.getAvg(j) * 11, 120);
}
}
1