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.
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: loopNumSnippet
Built with Processing