processing / processing-sound-archive

Archived Sound Library for Processing
125 stars 62 forks source link

.isPlaying() always returns 1 #126

Open francescosoave opened 6 years ago

francescosoave commented 6 years ago

as per title, .isPlaying() always returns integer 1 even after the SoundFile has ended. In the following code, the else is never executed. Processing 3.3.7, sound library version 1.4.0

import processing.sound.*;
SoundFile f;

void setup() {   
  f = new SoundFile(this, "/samples/sample02.mp3");
  f.play();
}      

void draw() {    
  if(f.isPlaying() == 1)
    println("playing: " + f.isPlaying());
  else  
    println("ended " + f.isPlaying());
}
borogoves commented 6 years ago

I found this to be a problem too. I'm trying to sequence three sounds together, starting the next as soon as the previous is done. Using isPlaying() would be the right way to do this, but it doesn't work because of this bug.

mdecoster commented 6 years ago

I am having the same problem as of Oct 23, 2018. Always 1.