I've been trying to use SoundPool to play the default ringtone without success. In the code below
String ringtone = Settings.System.DEFAULT_RINGTONE_URI.getPath();
SoundPool ringPhone = new SoundPool(2, AudioManager.STREAM_RING, 1);
int soundID = ringPhone.load(Settings.System.DEFAULT_RINGTONE_URI.getPath(), 1);
int soundID = ringPhone.load(ringtone, 1);
ringPhone.play(soundID, 0.99f, 0.99f, 1, 0, 1);
I get the message "error loading content /system/ringtone sample 0 not READY". Replacing the URI with a hard path to an existing mp3 file on the sd card yields similar results.
What am I doing wrong? Thanks,
kyle