prevent a clip get closed

java sound cannot play after is closed!.

im using clips to play .wav files on raspberry pi device, I checked that on windows laptop and was working without issue, but when I run the game in raspberry, after a time or after play like 6-times the sounds, I got an error of LineException, I checked the state of the clip and every time im receiving those exceptions the clip is closed, I would like to know how to prevent that, the code im using is the next one:

on branch develop, and im also using the first play method. As I said work in windows but not all the time on RPI, Im gonna check this week on Linux mint and macos