Tree-Axis ``` Processing  


Back  
Class   RateShift
   
Name  

getOutputSize()

   
Examples  
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;
RateShift myRateShift;

void setup() {
  size(256,200);

  // start up Ess
  Ess.start(this);

  // load "cell.aif" into a new AudioChannel
  myChannel=new AudioChannel("cell.aif");

  // rate shift the first 2 seconds
  myRateShift=new RateShift(Ess.calcShift(3));
  
  myRateShift.filter(myChannel,0,myChannel.frames(2000));
  
  // figure out where to start a second rate shift
  int nextShift=myRateShift.getOutputSize(myChannel.frames(2000));
  
  // second rate shift
  myRateShift.percent=Ess.calcShift(6);
  
  myRateShift.filter(myChannel,nextShift,myChannel.frames(3000));

  // play
  myChannel.play();
}

void draw() {
}

// we are done, clean up Ess

public void stop() {
  Ess.stop();
  super.stop();
}


Description   Used to determine the recommended (exact) output buffer size in sample frames based on the passed input buffer size and the filter's shift percent
   
Syntax  
rateshift.getOutputSize(inputSize)
   
Parameters  
rateshift   any instance of RateShift

inputSize   the input buffer size in sample frames

   
Returns   nothing
   
Usage   Web & Application
   
 
 






   
 
Updated: Tue May 31 04:52:40 PDT 2006


 
  Questions, comments, corrections: e-mail Krister Olsson.