Forcing notifications to loudspeaker when headphones plugged in programatically.

573 views
Skip to first unread message

Dale Newton

unread,
Jan 23, 2014, 6:50:23 PM1/23/14
to tas...@googlegroups.com
Hi,

Could someone suggest how I might go about forcing audio to the loudspeaker programatically when the headphones are plugged in?

Are there any commands that can be run in a shell like 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: http://developer.android.com/reference/android/media/AudioManager.html 

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

The SoundAbout app and tasker kind of works, bit only if you force basically everything including media sounds through the speaker; also Im finding that as the Alarm is not recognised by tasker on my phone unless its by the %WIN variable, the SOUndAbout app comes to the front then loads again when you press back to try and get at the alarm.  Maybe theres a way around that but I dont see any way for the audio routing problem.
.
Im not  programmer but I have written a few scripts for autohotkey, and for batch files in Windows.



Dale Newton

unread,
Jan 23, 2014, 6:54:30 PM1/23/14
to tas...@googlegroups.com
I should say, the device is a Galaxy S2 with a custom Rooted ROM, and its so that the alarm and calendar notifications come through the phone speaker when headphones or a portable speaker is connected (which usually switch themselves off when the music stops playing, thus making alarms silent)



Scott Miller

unread,
Jan 23, 2014, 7:09:01 PM1/23/14
to tas...@googlegroups.com

If it's physically connected with a wire to the headphone plug on the device, I don't think there will be anything you can do. That is a physical switch that cuts off the speaker. There isn't any way to use an app to bypass that behavior. You would need to modify the hardware.

Scott

On Jan 23, 2014 6:54 PM, "Dale Newton" <d.e.a....@gmail.com> wrote:
I should say, the device is a Galaxy S2 with a custom Rooted ROM, and its so that the alarm and calendar notifications come through the phone speaker when headphones or a portable speaker is connected (which usually switch themselves off when the music stops playing, thus making alarms silent)



--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/groups/opt_out.

Dale Newton

unread,
Jan 23, 2014, 7:28:35 PM1/23/14
to tas...@googlegroups.com
Thanks, that cant be the case though, as the audio does indeed get routed to the speaker by the SoundAround app - but so far it isnt working well (problems described in OP).
 

Dale Newton

unread,
Jan 24, 2014, 7:09:36 AM1/24/14
to tas...@googlegroups.com
Sorry, the app is SoundAbout not SoundAround.


On Fri, Jan 24, 2014 at 1:28 AM, Dale Newton <d.e.a....@gmail.com> wrote:
Thanks, that cant be the case though, as the audio does indeed get routed to the speaker by the SoundAround app - but so far it isnt working well (problems described in OP).
 

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/TmAQkwEWkcg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages