Tree-Axis ``` Processing  


Back  
Class   FFT
   
Name  

getLevel()

   
Examples  
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;
FFT myFFT;

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

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

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

  // we just want the level, so we pass nothing
  myFFT=new FFT();
  
  // start the sound looping forever
  myChannel.play(Ess.FOREVER);
}

void draw() {
  // set the background color to a shade of blue based on the level
  int bgdColor=(int)(myFFT.getLevel(myChannel)*255);
  
  background(bgdColor,bgdColor,255);
}

// we are done, clean up Ess

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


Description   Returns level information based on the passed AudioChannel, AudioStream, AudioInput, or float array
   
Syntax  
fft.getLevel(src)
fft.getLevel(srcArray, offset) 
   
Parameters  
fft   any instance of FFT

src   the source AudioChannel, AudioStream, or AudioInput instance

srcArray   float[]: the source array containing sample data

offset   int: the sample frame from which to start analysis

   
Returns   nothing
   
Usage   Web & Application
   
 
 






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


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