Back
Class   Sample
   
Name  

stop()

   
Examples  
// Play a sample on mousePressed, and stop the sample on mouseReleased. 
// 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(); 
} 
 
void mouseReleased(){ 
    mySample.stop(); 
} 
 
void mousePressed(){ 
    mySample.repeat(); 
} 
 

Description   Stops the sample currently playing. If a timer is included, the sample will be unloaded from memory using the specified number of ticks (at least 10 is recomended).
   
Syntax  
mySample.stop()
mySample.stop(timer)
   
Parameters  
timer   int

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