I don't know the answer right now, but I suggest to look at the examples coming with Processing:
PDE > File > Examples > Libraries > Minim
I am pretty sure there is one example showing how to play a sound when clicking.
PDE > File > Examples > Libraries > Minim
I am pretty sure there is one example showing how to play a sound when clicking.