Using Sound with Processing

I am trying to add sound to my code using the Processing sound library but the sound is very slow and suddenly stops playing. I am working with an IMac 8Gb of Ram using Sur.
The code is correct, I tested it on other computers but in my particular computer is not. What could it be?

Thank you in advance!