minim fileplayer loopcount problem

edited January 2014 in Library Questions

hi, i was trying out minim to make a loop pedal, using FilePlayer as my audio player in case i wanted to use ugens on it. I needed to track how many loops it has currently and set events according to that. the problem is that its loopCount() doesn't change even if the file obviously had looped already, as opposed to AudioPlayer. is this just me or is it actually a bug?

below is a sample code i made to test FilePlayer loopCount() when it wasn't working in my code

import ddf.minim.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;

Minim john;
AudioInput in;
AudioOutput out;
FilePlayer player;
//AudioPlayer player; 

void setup()
{
  size(200,200);
  john = new Minim(this);
  in = john.getLineIn(Minim.STEREO, 2048);
  out = john.getLineOut(Minim.STEREO);

  AudioRecordingStream stream= john.loadFileStream("test.wav",1024,false);
  player = new FilePlayer(stream);
  player.patch(out);
  //player = john.loadFile("test.wav",1024); //audioplayer loop
  player.loop(3);
}

void draw()
{
  println(player.loopCount());
}

Answers

  • Hello there, had a same problem. With minim 2.+ there were some changes. The problem exists in minim source. ddf.minim.javasound.JSBaseAudioRecordingStream.java file method: readBytesLoop() line : if ( toLoopEnd < rawBytes.length ) should be changed by: if ( toLoopEnd <= rawBytes.length )

Sign In or Register to comment.