Tree-Axis ``` Processing  


Back  
Class   AudioChannel
   
Name  

bufferSize()

   
Examples  
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;
TriangleWave myWave;

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

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

  // create a new AudioChannel
  myChannel=new AudioChannel();

  // set the size to 5 seconds
  myChannel.initChannel(myChannel.frames(5000));

  // generate 3 seconds of a soft triangle wave
  myWave=new TriangleWave(480,.1);
  myWave.generate(myChannel,0,myChannel.frames(3000));

  // set the playback buffer to 3 seconds
  myChannel.bufferSize(myChannel.frames(3000));

  // play
  myChannel.play();
}

void draw() {
}

// we are done, clean up Ess

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


Description   Sets the size of an AudioChannel's playback buffer. The size of the buffer determines the number of samples sent to the sound playback engine at one time. Larger buffers play more smoothly, but cannot be started and stopped quickly. Smaller buffers are more responsive, but prone to static
   
Syntax  
channel.bufferSize(size)
   
Parameters  
channel   any instance of AudioChannel

size   int: the new size of the sample buffer in sample frames

   
Returns   nothing
   
Usage   Web & Application
   
 
 






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


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