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,991
  • 11
  • 77
  • 112
Asaf Nevo
  • 11,338
  • 23
  • 79
  • 154

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
  • 11,338
  • 23
  • 79
  • 154
  • 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