| 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 |  | ### samples[]
Examples |  |
    BSound clong;

    void setup() {
      beginSound(100);
      clong = loadSound("clong.wav");
      repeat(clong);
    }

    void loop() {
      background(204);
      for (int i=0; i < length-1; i=i+1) {
        line(i, samples[i] + 50, i+1, samples[i+1] + 50);
      }
    }
Description |  | An array containing the values of all the audio samples contained in the current audio frame. All sounds are made of many audio samples which are integer value between 127 and -127. Values outside this range are clipped to the closest value. To use the samples[] array, sound should be initiated by calling beginSound(length) inside the setup() method, where length is the number of samples in each audio frame. The samples[] array should be modified in the soundEvent() method, but can be read in loop(). The samples[] array represents the sounds that are currently playing at the moment soundEvent() is called.
Syntax |  |
    samples[index]
Usage |  | Web & Application
Related |  | BSound beginSound() length

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