• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Mods Forcing notifications audio to loudspeaker programmatically when headphones in. [Root only]

califauna

Newbie
Hi,

How I might go about forcing notification audio to the loudspeaker programatically when the headphones are plugged in?

Are there any commands that can be run in a shell like that available in the security settings plugin which could do this, or saved as a file and then run by tasker?

It seems this class in the Android APIs would be for that: AudioManager | Android Developers

Id like to know though if there's a way to do it without having to develop an app or get in so deep (though the SDK there does look really impressive and beginner friendly)

The problem is that the alarm cant be heard in the morning when the headphones are left in, or an external speaker attached (which switches itself off in the night when the music stops playing)

Phone is i9100 and ROMs are custom ROMs (now trying out RR Kit Kat).

Thanks.

Note:

Tasker and Sound Around kind of works, but only if you force basically everything including media sounds through the speaker. Also Im finding that the Alarm is not recognised by tasker on my phone unless its by the %WIN variable, so Sound Around is loaded automatically by tasker in response to the alarm window. This means that when Sound Around is closed to get at the alarm it is instantly reloaded again by tasker, so you cant get to the alarm screen. Maybe theres a way around that but I dont see any way for the audio routing problem so far so looking for a manual solution with a script or some kind or command.
 
In most phones, when you plug a plug into the headphone jack, the speakers are physically disconnected in hardware. You'd have to add a function in Android to send a signal to a relay which would reconnect the speakers when you want speaker output with a plug in the jack. (And you'd have to add the relay.)
 
Thanks for the suggestion, but that cant be the case with my phone (i9100). The app called Sound About can already direct sound to the speakers with the headphones in, but it isnt a good solution (problems described above).
 
Back
Top Bottom