Back
Class   Sample
   
Name  

isPlaying()

   
Examples  
// Print the current status of the sample. 
// Notes: Make sure to include the specified audio file in your project's 'data' folder. 
 
boolean doOnce; 
Sample mySample; 
void setup() { 
  size(100,100); 
  Sonia.start(this); 
  doOnce = true; 
  mySample = new Sample("sine.aiff"); 
  mySample.play(); 
} 
 
void loop(){ 
  if(mySample.isPlaying()){ 
    print("...Sample is playing..."); 
  } else if(!mySample.isPlaying() && doOnce){ 
    print("...Sample has stopped..."); 
    doOnce = false; 
  } 
} 
 
public void stop(){ 
  Sonia.stop(); 
  super.stop(); 
} 

Description   Returns TRUE if the sample is playing and FALSE if it is not.
   
Syntax  
mySample.isPlaying()
   
Returns   boolean
   
Usage   Web & Application
   
Related   getNumFrames()
getCurrentFrame()