I want to play sound files when user click on certain text. I have sound files list in my database and the sound files are downloading successfully in my app. I am trying to play these files using MediaPlayer
. The issue is I cannot find the URI required to play MediaPlayer
. Thus resulting in null media-player object. I have tried nearly all the solutions listed on internet but non solved my issue. The path of sound file while downloading from database is
"/data/user/0/mypackage/files/Sound/diabetes_ur_sound_1_1_1_1.0.0.0.mp3".
Screenshot of one of the method that I used is attached with the debugger output.
Code:
Debugger Output:
setDataSource(filePath);
method ofMediaPlayer
/storage/sdcard0/Recordings/RECORDING_20180207_124312.m4a