Back
Class   Sample
   
Name  

getSpeed()

   
Examples  
// Print the default speed of the sample object. 
// 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.aif"); 
  float speed = mySample.getSpeed(); 
    println("the sample's speed is:" + speed);  // prints '1.0' as the speed has not changed. 
} 
 
// safely stop the Sonia engine upon shutdown. 
public void stop(){ 
  Sonia.stop(); 
  super.stop(); 
} 

Description   This is an alternative method to getRate() for reading sample-rate of the sample.
   
Syntax  
mySample.getSpeed()
mySample.getSpeed(channel)
   
Parameters  
channel   0 or Sonia.LEFT for Left channel, 1 or Sonia.RIGHT for Right channel

   
Returns   float
   
Usage   Web & Application
   
Related   setSpeed()
setRate()
getRate()