I walk outside listening to Pandora quite a lot, and today I realized that I miss about half the SMS’ that I get. Either because it’s too noisy, or maybe because the SMS’ are not loud enough and I use a single beep, or because the sound trigger gets interrupted by Pandora, but either way, it’s a bit annoying. I have been considering some sort of a solution that will play incoming SMS messages when my headphones are plugged in for quite some time, but I couldn’t think of an efficient way to do it — that is, efficient on the battery. I think I came up with one today.

The idea behind this Tasker program is the following:

There are two Profiles: ‘Detect Headphones‘ and ‘Play Text Over Headphones‘. Only one Profile has to be actually active at all times – the Detect Headphones one. When you plug in your headset (with microphone, or just regular headphones), the profile sets a variable %HEADPHONES to ‘yes’. It then turns on the second Profile – the one that monitors incoming SMS messages and plays them over the headset if your %HEADPHONES variable is set to ‘yes’.

The interesting discovery I made was about pausing/muting Pandora. My solution was to set the Media volume to 0, and to set the In-Call volume to 4 (since 5 is too loud over headphones), then play the SMS using the In-Call audio channel, and then set the Media volume to 9 (roughly ‘normal’) and the In-Call volume to 5 (max). When you unplug your headphones, the Detect Headphones profile clears the variable, and de-activates the Play Text Over Headphones profile. I truly don’t think there is a more efficient way to write this, both in terms of simplicity and in terms of battery usage — which is currently <1-2% throughout the day.

So, to recap, the only side effect after you are done with all of this is that your Media volume will be set to 9, and your In-Call volume will be set to 5. Both of these can be customized to values that you find appropriate. Also, instead of setting each individually, you may just re-call one of my sound-profile tasks (like ‘Work’, or ‘Normal’, or ‘Sleep’)

Here are the Profiles:

Headphones.zip [updated: 02-22-2012]
(md5: abd66180b4f5c75125ef48e9c5e95f80)

BUGS: There aren’t any really, but I’ve noticed that If you receive multiple SMS’ quickly (ex: someone sending “1”, “2”, “3” within a second or two, it will only pick up the first – this is a limitation on the Android notification detection framework. Also, I am sure that even if that wasn’t a limitation, the sound synthesizer would not be able to keep up.

Hope you enjoy, and as always, leave comments – both about things that work and things that don’t.

5 Thoughts on “Speak SMS over the Head Phones only when they are plugged in

  1. Hi there!

    I downloaded the zip file and I could barely understand it. It gave me a bunch of numbers. Is there anyway you could email me the breadcrumb trail(step by step) guide on how to do this please?

    This is greatly appreciated :)

    Thanks my friend!

  2. Hey – if you haven’t used tasker, check out these two posts:

    1.) http://blog.vpetkov.net/2011/05/10/androids-best-app-tasker-visual-programming-and-automation/
    This will tell you about the major components


    2.) http://blog.vpetkov.net/2011/05/10/my-tasker-program-blackberry-sound-profiles-for-android/
    This should tell you how to import things. See especially steps 2-4. With new versions of Tasker things have changed a bit menu-wise, but you should be able to figure it out.

    When you install tasker, the basic idea is that you will create the profiles by dropping them into the right folders on your SD Card – you will need to create the folders if this is the first time. After that, you can import them, enable them, and the rest should happen automatically.

  3. Here are some steps that should better explain this:

    1.) First – You need to have Tasker :)
    2.) You need the correct folders on your SD card. From this URL (http://tasker.dinglisch.net/userguide/en/faqs/faq-how.html#q), it sounds like the new version of Tasker might be able to create them for you just by importing, so:
    You just need to download the zip, extract it, go into Tasker and do an import of both profiles.
    3.) Enable the “Detect_Headphones” profile.
    4.) The idea is that that profile will monitor for the physical plugging in and out of your headphones. When they are plugged in, it will enable for you the “Play_Text_Over_Headphones” which does everything. When you remove your headphones, it will disable the “Play_Text_Over_Headphones” profile, and monitor for your headphones again.

  4. Hey Ventz!

    I am both shocked and incredibly impressed with how quick you responded :D

    Apparently I am not new to tasker,in fact I’ve created 8 working profiles already. Although, I admit that I am fairly new to importing profiles.

    Thanks a bunch! I shall read up on it shortly and see if I could make it work.

    Keep up the good work!


  5. Hiya Ventz!

    I’ve read the post and followed the instructions. Sadly, my tasker wont recognize the files I unzipped. At your convenience, please please please send me the step by step guide instead :'(

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation