How to momentarily download the sounds of other applications

Asked

Viewed 26 times

0

I’m using the Mediaplayer Class to play an alert sound in my app. My problem is that if the user is listening to music through another application, the sound emitted by my Mediaplayer Class may not be noticed. There is the possibility to momentarily download the sound of other applications (same as with the Notifitionmanager class)?

MediaPlayer mediaPlayer = MediaPlayer.create(getApplicationContext(), R.raw.alert_19);
            mediaPlayer.start();
  • I believe it has to do with sound priority, see that question on Soen, and if any of the answers answers.

  • @Diegof, I applied values of 0 and 1 to the priority, and tested the sound in parallel with the Google application "Play Musica" playing a song. The sound of the Google app didn’t momentarily mute when I played the sound of my app! What values should I assign to the priority, so that my application can download the sound of other applications?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.