0

I need play some audio through internal speaker.

audioManager.setMode(AudioManager.MODE_IN_CALL);
audioManager.setSpeakerphoneOn(true);

My problem - when i do this, if another app play audio, he start playing too through internal speaker. How i can avoid it?

I read this topic: How to stop other apps playing music from my current activity? but in my case i want force closing any audio playing.

Community
  • 1
  • 1
phnmnn
  • 12,813
  • 11
  • 47
  • 64
  • why do you need to stop thea app , you can request audio focus `requestAudioFocus` before playing the audio file and then abandon the audio focus after you finish `abandonAudioFocus` and usually apps mutes the audio when they are not in focus – Saddam Abu Ghaida Dec 30 '14 at 14:43
  • possible duplicate of [How to stop other apps playing music from my current activity?](http://stackoverflow.com/questions/15390126/how-to-stop-other-apps-playing-music-from-my-current-activity) – petey Dec 30 '14 at 15:00

0 Answers0