Sample data to array [toxi.audio]
in
Contributed Library Questions
•
1 year ago
I would like to load sample values from an aiff file into float array. What would be the correct way to do that?
my attempt looks like this:
import toxi.audio.*;
import toxi.geom.*;
audioSys = JOALUtil.getInstance();
audioSys.init();
source=audioSys.generateSourceFromFile(dataPath("synth.wav"));
float data[];
data = source.toArray();
println (source.length());
println (data.length); // equals 3 which doesn't seems right..
perhaps there is a way to directly access the sample values from Spline2D?
my attempt looks like this:
import toxi.audio.*;
import toxi.geom.*;
audioSys = JOALUtil.getInstance();
audioSys.init();
source=audioSys.generateSourceFromFile(dataPath("synth.wav"));
float data[];
data = source.toArray();
println (source.length());
println (data.length); // equals 3 which doesn't seems right..
perhaps there is a way to directly access the sample values from Spline2D?
1