Check out example codes for "play sound android studio kotlin". It will help you in understanding the concepts better.

Code Example 1

//make a audio file in the res/raw directory
mediaPlayer = MediaPlayer.create(this, R.raw.FILE_NAME)
mediaPlayer?.start()

Learn ReactJs, React Native from akashmittal.com