p5.SoundFile has two play modes: restart
and sustain
. Play Mode determines what happens to a p5.SoundFile if it is triggered while in the middle of playback. In sustain mode, playback will continue simultaneous to the new playback. In restart mode, play() will stop playback and start over. With untilDone, a sound will play only if it's not already playing. Sustain is the default mode.
Examples
Syntax
playMode(str)
Parameters
str
String:
'restart' or 'sustain' or 'untilDone'
Notice any errors or typos? Please let us know. Please feel free to edit lib/addons/p5.sound.js and open a pull request!