Tree-Axis ``` Processing  


Back  
Class   AudioChannel
   
Name  

loadSound()

   
Examples  
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;

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

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

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

  // start the sound looping forever
  myChannel.play(Ess.FOREVER);
}

void draw() {
}

// we are done, clean up Ess

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


Description   Loads a sound into an AudioChannel, setting the length of the AudioChannel's internal sample buffer to the length of the sound. Loop points and cue are reset on load. AIFF, WAVE, AU, and if the appropriate JARs are installed (see the Ess home page), MP3 files may be loaded from within the sketch's data folder, the Web (unsigned applets can only load sounds from their own subdomain), or the local filesystem (applications and signed applets only). When loading a stereo sound a left/right channel may be specified, or both channels may be mixed to one mono channel. Only 16-bit samples are supported
   
Syntax  
channel.loadSound(filename)
channel.loadSound(filename, lrChannel)
   
Parameters  
channel   any instance of AudioChannel

filename   String: the sound to load

lrChannel   for stereo sounds, the channel to load: Ess.MIX (the default), Ess.LEFT, or Ess.RIGHT

   
Returns   nothing
   
Usage   Web & Application
   
 
 






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


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