To view this content, you need to install Java from java.com

This sketch is an example of how to use the get method of an AudioBuffer to get the value of a sample in one of an AudioSource's sample buffers. The classes in Minim that extend AudioSource and therefore inherit the left, right, and mix buffers of that class, are AudioInput, AudioOutput, AudioSample, and AudioPlayer. Not coincidentally, these are also all of the classes in Minim that are Recordable.

The value returned by get will always be between -1 and 1, unless you are using an AudioOutput whose signals mix together to produce sample values outside of this range. If that is the case you will notice it right away because the audio will sound distorted. You can use get to draw the waveform of the audio in an AudioBuffer, but it is not the best choice for doing so. See the toArray example for more about this.

Source code: get

Built with Processing