This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

This sketch demonstrates how to use the loop(int) method of a Playable class. The class used here is AudioPlayer, but you can also loop an AudioSnippet. When you call loop(int) it will make the Playable loop for the number of times you specify. So, loop(3) will loop the recording three times, which will result in the recording being played 4 times. This may seem odd, but it is consistent with the behavior of a JavaSound Clip. If you want to make it stop looping you can call play() and it will finish the current loop and then stop. Press any of the number keys to make the player loop that many times. Text will be displayed on the screen indicating your most recent choice.

Source code: loopNum waveform

Built with Processing