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

This sketch demonstrates how to use the cue method of a Playable class. The class used here is AudioPlayer, but you can also cue an AudioSnippet. When you cue, it is always measured from the beginning of the recording. So cue(100) will set the "playhead" at 100 milliseconds from the beginning no matter where it currently is. Cueing a Playable object will not change the playstate, meaning that if it was already playing it will continue playing from the cue point, but if it was not playing, cueing will not start playback, it will simply set the point at which playback will begin. If an error occurs while trying to cue, the position will not change. If you try to cue to a negative position or try to cue past the end of the recording, the amount will be clamped to zero or length().

Press 'c' to cue to 5000 milliseconds.

Source code: cue waveform

Built with Processing