Go Back   Android Forums > Android Discussion > Android Applications > Tasker

test: Reply
 
LinkBack Thread Tools
Old December 4th, 2012, 11:17 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Dec 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Pause Music and Say Sender and Body

I ride a motorcycle daily and listen to music via wired earbuds. I would like for the music to be paused when I receive a new SMS, play the notification sound, read the senders name and message, and finally resume the music.

I set it up and it works great when tested with the small "Play" button at the bottom of the TASK. When I have my buds in and playing music, it works sometimes and other times it resumes music immediately after saying %SMSRN.

This is what I have set up so far:

Context 1: Headset Plugged, Any
Context 2: Received Text SMS, *,*

Task:
Media Control, Toggle Pause, Sim Media Button
Sys Volume, Level 15
Wait, 4seconds (waiting for text notification to finish (BRRAAAAAAINS))
Say, Text From %SMSRN,Stream w/Media
Wait, 600milsec (pause between Name and Body)
Say, %SMSRB, Stream w/Media
Sys Volume, Level 12
Wait, 2seconds
Media Control, Toggle Pause, Sim Media button

Advertisements
notyours07 is offline  
Reply With Quote
sponsored links
Old December 9th, 2012, 07:13 AM   #2 (permalink)
New Member
 
Join Date: Dec 2012
Posts: 2
 
Device(s): GS3
Carrier: Verizon

Thanks: 2
Thanked 0 Times in 0 Posts
Default

I'm using roughly the same setup with both a headset and BT (couldn't figure out how to do it in one profile so I made 2). Reads perfectly but if I'm not listening to music when I have my headset/BT on it turns it on when I get an SMS. I'm sure there's an easy way to fix it but I haven't been able to figure it out yet.

Any suggestions anyone?

TL/DR: How do I get tasker to decide if music is playing before deciding to toggle pause.
RogueOne42 is offline  
Reply With Quote
Old December 13th, 2012, 07:27 AM   #3 (permalink)
Junior Member
 
Join Date: Oct 2012
Posts: 92
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 12 Times in 12 Posts
Default

One way should be to set a variable after your media play command like:

Variable set:MUSICPLAYING to on.

Then on your read SMS profile task include an if statement with your say command like:
Say bla bla bla: if MUSICPLAYING is on.

Just make sure to add in your exit task to variable set the MUSICPLAYING to off.

Or you could use the same variable to turn the entire SMS profile off if music isn't playing. Then turn it back on when the play button is pressed again.

OP, I think you need a longer pause than 2 sec.
tatootie67 is offline  
Last edited by tatootie67; December 13th, 2012 at 07:30 AM.
Reply With Quote
The Following User Says Thank You to tatootie67 For This Useful Post:
RogueOne42 (December 21st, 2012)
Old December 19th, 2012, 08:14 AM   #4 (permalink)
New Member
 
Join Date: Dec 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default

I want the exact same thing as RogueOne42.
But I can't figure it out.

How can I set the variable when the music starts playing when I control it by car?
I can't find an option to set a var as soon as media is playing.

If I had that option I would just make 2 profiles:
1. Connected to Bluetooth + receive text = read sms
2. Connected to Bluetooth + receive text + music is playing = pause music, read sms, unpause music.


Edit: Found a solution

Make 2 profiles.

Profile 1 - "SMS + Bluetooth"
State:
* Bluetooth connected
* Received Text Any
* Variable Value %MTRACK, Isn't Set

Task:
* Wait 1sec
* Say, Text: BlaBla %SMSRN BlaBla %SMSRB, Stream: Ringer

Profile 2 - "SMS + Bluetooth + Music"
State:
* Bluetooth connected
* Received Text Any
* Variable Value %MTRACK, Is Set

Task:
* Media Control, Pause, Sim Media Button On
* Wait 1sec
* Say, Text: BlaBla %SMSRN BlaBla %SMSRB, Stream: Ringer
* Media Control, Play, Sim Media Button On
rubeast is offline  
Last edited by rubeast; December 19th, 2012 at 09:36 AM.
Reply With Quote
The Following User Says Thank You to rubeast For This Useful Post:
RogueOne42 (December 21st, 2012)
Old December 21st, 2012, 09:24 PM   #5 (permalink)
New Member
 
Join Date: Dec 2012
Posts: 2
 
Device(s): GS3
Carrier: Verizon

Thanks: 2
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by rubeast View Post

Edit: Found a solution

Make 2 profiles.

Profile 1 - "SMS + Bluetooth"
State:
* Bluetooth connected
* Received Text Any
* Variable Value %MTRACK, Isn't Set

Task:
* Wait 1sec
* Say, Text: BlaBla %SMSRN BlaBla %SMSRB, Stream: Ringer

Profile 2 - "SMS + Bluetooth + Music"
State:
* Bluetooth connected
* Received Text Any
* Variable Value %MTRACK, Is Set

Task:
* Media Control, Pause, Sim Media Button On
* Wait 1sec
* Say, Text: BlaBla %SMSRN BlaBla %SMSRB, Stream: Ringer
* Media Control, Play, Sim Media Button On
I couldn't figure it out so I swapped the Say stream to Call and have it drop the media volume down when it reads the text. When it's finished reading it sets the media volume back.
RogueOne42 is offline  
Reply With Quote
Old January 5th, 2013, 09:46 PM   #6 (permalink)
From My Cold Dead Hands
 
330D's Avatar
 
Join Date: Mar 2010
Location: upstate NY
Posts: 2,863
 
Device(s): Googlerola Droid Maxx, Moto Spyder, HTC Knight retired, HTC Hero retired,
Carrier: Not Provided

Thanks: 507
Thanked 784 Times in 519 Posts
Default

I bought tasker for this specific action, and I am having a hell of a time understanding what to do... I have a Motorola Droid RAZR, and with smart actions alone I can get it to announce the sender of a received text while my headphones are plugged in, but I would like the text read to me. I am very very new to tasker and don't fully understand what I need to do to get there. Anyone want to lend a hand getting me there I would really appreciate it!
330D is offline  
Reply With Quote
Old January 6th, 2013, 07:44 AM   #7 (permalink)
Junior Member
 
Join Date: Oct 2012
Posts: 92
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 12 Times in 12 Posts
Default

%SMSRF is the sender.
%SMSRB is the message.
All you have to do is use the say command with those variables to read out loud the last text received.
Use received SMS as your context

Example:
Profile: read SMS headphones
Context: headphones plugged
Context: received SMS

Task: read SMS
Say %SMSRF sent you the following text message. %SMSRB
tatootie67 is offline  
Last edited by tatootie67; January 6th, 2013 at 07:48 AM.
Reply With Quote
Reply


Go Back   Android Forums > Android Discussion > Android Applications > Tasker
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:09 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.