Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force output sound to internal speaker while headphones plugged in

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.

like image 342
Ahmed Hegazy Avatar asked Apr 24 '16 11:04

Ahmed Hegazy


People also ask

How can I play audio through my speaker when my headset is plugged in?

A splitter offers a plug-and-play solution. Simply plug the splitter into your PC and plug the headphones into one port and the speakers into another. It's best to buy a high-quality audio splitter.

How do I turn on speakers when headphones are plugged in Windows 10?

Right click the speaker on the taskbar, click on Playback device, right click on Speaker, click in Disable. When finished with headphones do again except Enable rather than Disable.


1 Answers

Hello use this instead:

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

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

like image 122
mangu23 Avatar answered Oct 05 '22 23:10

mangu23