10

How do I make the internal phone speaker play sound while plugging in my headphones? I see that it's possible by using the SoundAbout app.

I've tried this answer which suggests

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

I may have done it in the wrong way. I'm just setting that and using the MediaPlayer to play some music.

I'm using Nexus 6 to do this test.

Community
  • 1
  • 1
Ahmed Hegazy
  • 12,395
  • 5
  • 41
  • 64
  • Did you checked this [link](http://stackoverflow.com/a/6847737/4310784)? I had same problem and it saved me! – Mohammad Zarei Apr 24 '16 at 11:34
  • Possible duplicate of [Is there any way to force audio through the speakers when headphones are plugged in?](http://stackoverflow.com/questions/6834816/is-there-any-way-to-force-audio-through-the-speakers-when-headphones-are-plugged) – Tomik Apr 24 '16 at 11:38
  • @MohammadZ It doesn't work for me. I'm using Marshmaellow btw. – Ahmed Hegazy Apr 24 '16 at 11:44

1 Answers1

1

Hello use this instead:

mAudioManager.setMode(AudioManager.MODE_CURRENT);
mAudioManager.setSpeakerphoneOn(true);

I am using the Nexus 6 device as well. Hope this helps!

mangu23
  • 884
  • 9
  • 13