I wanted to load files from the SD card into a SoundPool as well as ringtones. I am able to successfully get the path of the files, and I am able to play them with MediaPlayer. However, I need the functionality of the SoundPool. I have tried SoundPool.load(String, int) but it appears to not load the file. Is it possible to load files from the SD card into a SoundPool, or is there a better way to do this?Answer1:
You can use
android.os.Environment.getExternalStorageDirectory() to get the directory to your sdcard and append the file and extension, you can then use SoundPool with
load(String path, int priority), to access your file.
Or while not recommended you can even hardcode your path to "/sdcard/".
If the problem is not with getting the soundfile path then you can take a look at <a href="http://www.droidnova.com/creating-sound-effects-in-android-part-1,570.html" rel="nofollow">Creating Sound Effects in Android</a>