When I launch a file using your example program that demos isPlaying() the isPlaying() function indicates the file is not playing before the end of the file is reached, cutting the file playing off
before it is done.
MacBook Pro 15" 2.4GHz Intel Core i5, QuickTime v.10.0
Processing v. 1.2.1
When play() is called again, the cut-off end of the file plays before the file starts again from the beginning. Surely this cannot be correct.
I have tried this with two different sound files, one .aif and a different one .mp3. It does the same thing with either type of file.
the code:
import ddf.minim.*;
Minim minim;
AudioPlayer groove;
void setup()
{
size(512, 200, P3D);
minim = new Minim(this);
groove = minim.loadFile("friend.aif", 2048);
textFont(createFont("Arial", 12));
textMode(SCREEN);
}
void draw()
{
background(0);
if ( groove.isPlaying() )
{
text("The player is playing.", 5, 15);
}
else
{
text("The player is not playing.", 5, 15);
}
}
void keyPressed()
{
if ( key == 'l' )
{
groove.loop(1);
}
if ( key == 'p' )
{
groove.play(0);
}
if ( key == 's' )
{
groove.pause();
}
}
void stop()
{
// always close Minim audio classes when you are done with them
groove.close();
// always stop Minim before exiting.
minim.stop();
super.stop();
}
MacBook Pro 15" 2.4GHz Intel Core i5, QuickTime v.10.0
Processing v. 1.2.1
1