Hello,
I am new to processing.sound and not that experienced generally so please forgive any silly mistakes.
import processing.sound.*;
FFT fft;
AudioIn in;
SoundFile snd;
int bands = 256;
float[] spectrum = new float[bands];
void setup() {
size(512,512);
fft = new FFT(this, bands);
in = new AudioIn(this, 2);
in.start();
snd = new SoundFile(this, "sample.mp3");
snd.play();
fft.input(in);
}
void draw() {
background(255);
fft.analyze(spectrum);
for(int i = 0;i<bands;i++) {
line(i,height,i,height-spectrum[i]*100);
}
}
I have almost verbatim copied the processing FFT example using an AudioIn, but I cannot get it to actually receive any audio from the soundcard. The code worked fine when fed a SoundFile. I’m running Windows 10, processing 3.5.3.
I presume the issue is in JSyn from the following errors:
Feb 17, 2019 6:03:58 PM com.jsyn.devices.javasound.JavaSoundAudioDevice <init>
INFO: JSyn: default output latency set to 80 msec for Windows 10
Feb 17, 2019 6:03:58 PM com.jsyn.engine.SynthesisEngine start
INFO: Pure Java JSyn from www.softsynth.com, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)
java.lang.RuntimeException: Audio Input not configured in start() method.
at com.jsyn.engine.SynthesisEngine.getInputBuffer(Unknown Source)
at com.jsyn.unitgen.ChannelIn.generate(Unknown Source)
at com.jsyn.unitgen.UnitGenerator.pullData(Unknown Source)
at com.jsyn.ports.PortBlockPart.pullData(Unknown Source)
at com.jsyn.ports.UnitInputPort.pullData(Unknown Source)
at com.jsyn.unitgen.UnitGenerator.pullData(Unknown Source)
at com.jsyn.ports.PortBlockPart.pullData(Unknown Source)
at com.jsyn.ports.UnitInputPort.pullData(Unknown Source)
at com.jsyn.unitgen.UnitGenerator.pullData(Unknown Source)
at com.jsyn.ports.PortBlockPart.pullData(Unknown Source)
at com.jsyn.ports.UnitInputPort.pullData(Unknown Source)
at com.jsyn.unitgen.UnitGenerator.pullData(Unknown Source)
at com.jsyn.ports.PortBlockPart.pullData(Unknown Source)
at com.jsyn.ports.UnitInputPort.pullData(Unknown Source)
at com.jsyn.unitgen.UnitGenerator.pullData(Unknown Source)
at com.jsyn.engine.SynthesisEngine.synthesizeBuffer(Unknown Source)
at com.jsyn.engine.SynthesisEngine.generateNextBuffer(Unknown Source)
at com.jsyn.engine.SynthesisEngine$EngineThread.run(Unknown Source)
Feb 17, 2019 6:04:08 PM com.jsyn.engine.SynthesisEngine$EngineThread run
INFO: JSyn synthesis thread in finally code.
Many thanks for any assistance.