Check out example codes for "how to play an audio in java". It will help you in understanding the concepts better.

Code Example 1

AudioInputStream input = new AudioInputStream(Path_to_the_file);
Clip clip=AudioSystem.geClip();
clip.open(input);
Clip.loop(Clip.LOOP_CONTINUOSLY);
clip.start();

Learn ReactJs, React Native from akashmittal.com