Hi there,
i am desperately trying to figure out, how to change the playback speed of a sample with minim.
I would like to use minim as it supports mp3s and works well with metadata.
The function setSampleRate() does not exist (as it does for Gain, Pan, etc...)
So i'm trying to directly control sampling rate like shown in the minim references (http://code.compartmental.net/tools/minim/manual-controller/).
I get the error "Cannot invoke setValue(float) on the primitive type float".
This is my
Code:import ddf.minim.*;
AudioPlayer player;
Minim minim;
void setup()
{
size(512, 200, P2D);
minim = new Minim(this);
// load a file, give the AudioPlayer buffers that are 1024 samples long
// player = minim.loadFile("groove.mp3");
// load a file, give the AudioPlayer buffers that are 2048 samples long
player = minim.loadFile("groove.mp3", 2048);
// play the file
player.play();
}
void draw()
{
if (player.hasControl(Controller.SAMPLE_RATE) )
{
// map the mouse position to the range of the sampling rate
float val = map(mouseX, 0, width, 0, 48000);
player.sampleRate().setValue(val);
}
else
{
text("There is no sampling rate control for this output.", 5, 15);
}
}
void stop()
{
// always close Minim audio classes when you are done with them
player.close();
minim.stop();
super.stop();
}
I'm starting to believe changing playback speed is not possible with minim...
Any help would be very much appreciated!
thx,
* jns