Back
Class   Sample
   
Name  

setSpeed()

   
Examples  
// Play a sample a twice its origianl speed. 
// 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.setSpeed(2); 
  mySample.repeat(); 
} 
 
public void stop(){ 
  Sonia.stop(); 
  super.stop(); 
} 

Description   This is an alternative method to setRate() for setting sample-rate of the sample.
   
Syntax  
mySample.setSpeed(Speed)
mySample.setSpeed(Speed, channel)
   
Parameters  
Speed   float: greater than or equal to 0

channel   0 or Sonia.LEFT for Left channel, 1 or Sonia.RIGHT for Right channel

   
Returns   None
   
Usage   Web & Application
   
Related   getSpeed()
getRate()
setRate()