Back
Class   Sample
   
Name  

getRate()

   
Examples  
// print the default sample-rate of 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.aiff"); 
  int rate = mySample.getRate(); 
  println("The sample's rate is:" + rate ); 
} 
 
// safely stop the Sonia engine upon shutdown. 
public void stop(){ 
  Sonia.stop(); 
  super.stop(); 
} 

Description   Returns the sample rate of the sample.
   
Syntax  
mySample.getRate()
mySample.getRate(channel)
   
Parameters  
channel   0 or Sonia.LEFT for Left channel, 1 or Sonia.RIGHT for Right channel

   
Returns   int
   
Usage   Web & Application
   
Related   setRate()
setSpeed()
getSpeed()