Tree-Axis ``` Processing  


Back  
Class   AudioChannel
   
Name  

buffer[]

   
Examples  
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;

void setup() {
  size(256,200);
  background(0,0,255);

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

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

  // start playing
  myChannel.play();
}

void draw() {
  stroke(255,10);

  // overlay an average of the samples in the buffer being played
  float inc=myChannel.buffer.length/256.0f;
  for (int i=0;i<256;i++) {
    int y=(int)(100+myChannel.buffer[(int)(i*inc)]*100);
    
    line(i-200,y-200,i+200,y+200);
  }
}

// we are done, clean up Ess

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


Description   The float array buffer will at any given moment contain a copy of the data being sent to the sound playback engine. buffer can be accessed to process sample data as it is being played. Set by bufferSize()
   
Syntax  
channel.buffer[]
   
Parameters  
channel   any instance of AudioChannel

   
Usage   Web & Application
   
 
 






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


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