2

i'm trying to load the phone default notification sound into my SoundPool.

i've tried

soundPool.load(Settings.System.DEFAULT_NOTIFICATION_URI.getPath(), 1)

and got

11-19 20:57:39.770: E/SoundPool(2948): error loading /system/notification_sound

how can i load it ?

Edward Falk
  • 9,685
  • 9
  • 73
  • 108
Asaf Nevo
  • 10,718
  • 22
  • 74
  • 151

1 Answers1

0

found my answer in this thread.

RingtoneManager.getRingtone(this, Uri.parse("content://media/internal/audio/media/122")).play();
Community
  • 1
  • 1
Asaf Nevo
  • 10,718
  • 22
  • 74
  • 151
  • 1
    That shows how to play it using the Ringtone class (which uses MediaPlayer internally). It would still be good to know how to load it into a SoundPool. – jk7 Apr 09 '18 at 23:59