Tree-Axis ``` Processing  


Back  
Class   AudioInput
   
Name  

stopFade()

   
Examples  
// Example by Krister Olsson

import krister.Ess.*;

AudioStream myStream;
AudioInput myInput;

boolean inputReady=false;
float[] streamBuffer;

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

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

  // create a new AudioInput
  myInput=new AudioInput(); 

  // create a new AudioStream
  myStream=new AudioStream(myInput.size);
  streamBuffer=new float[myInput.size];

  // start
  myStream.start();
  myInput.start();
  
  // fade to silence over 10 seconds
  myInput.fadeTo(0,10000);
}

void draw() {
}

void keyPressed() {
  // stop the fade and leave the volume where it is
  myInput.stopFade();
}

void audioStreamWrite(AudioStream theStream) {
  // block until we have some input
  while (!inputReady); 
  
  System.arraycopy(streamBuffer,0,myStream.buffer,0,streamBuffer.length);
   
  inputReady=false;
}

void audioInputData(AudioInput theInput) {
  System.arraycopy(myInput.buffer,0,streamBuffer,0,myInput.size);
  
  inputReady=true;
}

// we are done, clean up Ess

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


Description   If an AudioInput is actively fading as the result of fadeTo(), fading is terminated at the current recording volume
   
Syntax  
input.stopFade()
   
Parameters  
input   any instance of AudioInput

   
Returns   nothing
   
Usage   Web & Application
   
 
 






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


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