Back
Class   Sample
   
Name  

repeat()

   
Examples  
// Loop a sample. 
// Notes: Make sure to include the specified audio file in your project's 'data' folder. 
 
Sample mySample; 
 
void setup() { 
  size(100,100); 
  Sonia.start(this); 
  mySample = new Sample("sine.aiff"); 
  mySample.repeat(); 
} 
 
public void stop(){ 
  Sonia.stop(); 
  super.stop(); 
} 

Description   Loops the sample. If a range is specified the sample will play from the start frame to the end frame. A 44.1 kHz sample has 44100 frames per second. For example, frame 88200 would mark the two-second point in the sample.
   
Syntax  
mySample.repeat()
mySample.repeat(startFrame, endFrame)
   
Parameters  
startFrame   int: from 0 to the number of frames in the sample

endFrame   int: from 0 to the number of frames in the sample

   
Returns   None
   
Usage   Web & Application
   
Related   play()
repeatNum()
stop()