I have URI of the notification sound, like content://media/internal/audio/media/122
, but SoundPool
doesn\'t work with URIs, it works with only apk
Try this to get a full path:
String path = Environment.getRootDirectory().getAbsolutePath(); //Will return "/system"
path = path + Uri.getPath().subString(9); //To cut "content:/" from the Uri path.
//Then pass this "path" to your SoundPool
You are right. Unlike MediaPlayer which is used for music and videos, SoundPool is meant to be used for short app audio resources like notifications. It is much faster and lighter than MediaPlayer.