Play notification audio by URI

后端 未结 3 672
长情又很酷
长情又很酷 2021-01-05 18:50

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

3条回答
  •  鱼传尺愫
    2021-01-05 18:58

    Well, I got the easiest way to play audio by URI:

    RingtoneManager.getRingtone(this, Uri.parse("content://media/internal/audio/media/122")).play();
    

    I think this is the best what i could achieve.

提交回复
热议问题