| Language \ Environment \ Comparison |

| Index

| The Processing 1.0 _ALPHA_ Reference is a work in progress. If you see any errors or have any comments, please write to: reas at groupc.net

Name |  | ### soundEvent()
Examples |  |
    void setup() {
      // Initiate sound engine with a 512 audio buffer length
      beginSound(512);
    }

    void soundEvent() {
      for (int i=0; i < length; i++) {
        // Generate a sound using a sine wave
        samples[i] =  int(127 * sin(i));
      }
    }
Description |  | Called every time there is a new audio frame available. An audio frame is an array of audio samples that can be accessed using samples[] before it is sent to the audio device. An audio frame, similar to a video frame, has a finite size stored in the length variable. To use soundEvent(), beginSound(length) should be called inside setup(), where length is the dimension of each audio frame.
Syntax |  |
    soundEvent() {
      statements
    }
Parameters |  |
statements |  | any valid statements
Usage |  | Web & Application
Related |  | beginSound() samples[] length

| © 2003- 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea |
| Processing is an open project initiated by Ben Fry and Casey Reas |