I'm trying to load a wav file into a FilePlayer using Processing and Minim Library (later I want to patch a Delay on it). However, the wav file I was given plays too fast, at least at double the speed it is supposed to and it is very high pitched. The file sounds like it is supposed to if I play it in VLC Media Player or in WMP. It is 5 seconds long at a Bit Rate of 20kbps, but the code prints out it is 2299ms long.
Code:
import ddf.minim.*;
import ddf.minim.ugens.*;
import ddf.minim.spi.*;
Minim minim;
AudioOutput out;
FilePlayer filePlayer;
Delay myDelay;
void setup() {
size(100, 100);
minim = new Minim(this);
AudioRecordingStream myFile = minim.loadFileStream( "audio1.wav", 1024, true);
filePlayer = new FilePlayer( myFile );
filePlayer.play();
filePlayer.loop();
out = minim.getLineOut();
// patch the file player to the output
filePlayer.patch(out);
println(filePlayer.length()); //This prints out 2299
}
void draw()
{
background( 0 );
}