I need to insert a code, in function, that when called play a sound.
The problem is that the function is called faster than sound duration and so, the sound is played less times than function calls.
function keyDownSound(){
NSSound(named: "tennis")?.play()
}
The problem is that NSSound starts playing only if isn't already played. Any ideas to fix?