Record audio with Notification action

138 views
Skip to first unread message

ScottS

unread,
Feb 13, 2013, 8:34:24 PM2/13/13
to tas...@googlegroups.com
I have a successful Task/shortcut for toggling on/off audio recording (see below), though I would like the following additional options...

1. Ability to Stop the audio recording via notification click
2. Display the amount of time recorded in the notification

I've been unsuccessful to create a profile with notification click; not certain how to make it function, if in fact, that's what I need.

Record Audio (57)
A1: If [ %Recaudio ~ 0 ]
A2: Flash [ Text:Recording ON Long:Off ]
A3: Notify [ Title:Audio recording started Text: Icon:<icon> Number:0 Permanent:Off Priority:3 ]
A4: Record Audio [ File:/storage/sdcard1/Recordings/%DATE%TIME Source:Microphone MaxSize:0 Codec:AMR Narrowband Format:MP4 ]
A5: Variable Set [ Name:%Recaudio To:1 Do Maths:Off Append:Off ]
A6: Goto [ Type:Action Number Number:12 Label: ]
A7: End If
A8: Variable Set [ Name:%Recaudio To:0 Do Maths:Off Append:Off ]
A9: Flash [ Text:Recording OFF Long:Off ]
A10: Notify Cancel [ Title: Warn Not Exist:Off ]
A11: Record Audio Stop
A12: Stop [ With Error:Off Task: ]


Matt R

unread,
Feb 13, 2013, 9:18:44 PM2/13/13
to tas...@googlegroups.com
A notification click profile is what you need. I would troubleshoot that first. Perhaps you need to enable Tasker in the android accessibility settings?

Matt

ScottS

unread,
Feb 14, 2013, 9:57:42 AM2/14/13
to tas...@googlegroups.com
Figured it out; I had not realized the syntax of using the notification click; nothing to do with Accessibility settings.

Remaining Q...is it possible to change the Notification Icon? I don't see such option within the Notification Click Context dialog nor in the Profile Properties.

For the benefit of others, below is what I use. Basically, I start recording audio via Home Screen Shortcut, then stop it via notification click.

Record Audio (50)
A1: Flash [ Text:Recording ON Long:Off ]
A2: Notify [ Title:Audio Recording Text: Icon:<icon> Number:0 Permanent:Off Priority:3 ]
A3: Record Audio [ File:/storage/sdcard1/Recordings/%DATE.%TIME Source:Microphone MaxSize:0 Codec:AMR Narrowband Format:MP4 ]

Profile: Recording audio notification (46)
Event: Notification Click [ Owner Application:* Title:Audio Recording ]
Enter: Anon (49)
A1: Record Audio Stop
A2: Flash [ Text:Audio recording stopped Long:Off ]

Rich D

unread,
Feb 14, 2013, 5:51:26 PM2/14/13
to tas...@googlegroups.com

> Remaining Q...is it possible to change the Notification Icon? I don't see such option within the Notification Click Context dialog nor in the Profile Properties.

The icon is set and edited in the 'Notification' action that sets the notification...  A3 in your task..

Rich....

ScottS

unread,
Mar 25, 2013, 4:47:54 PM3/25/13
to tas...@googlegroups.com
I wanted to add a pop-up button to press to start the recording, rather than have the recording immediately start automatically when tapping the Home Screen Shortcut, though I can't seem to make it work effectively. Scenes are something I am completely at a loss with.

In the example below, I'm simply testing the pop-up- Flashing 'Test'. The Flash appears when I press the pop-up button, however, the Task does not stop and the pop-up does not close.

What must I add to stop the Task once I press the button and make the pop-up close?
 
Audio recording test (93)
A1: Show Scene [ Name:Record Audio Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:100 Show Exit Button:Off Continue Task Immediately:On ]

Scene: Record Audio
P:300x250 L:-1x-1
Element: Background/Image
Geometry:
P:0,0 300x250 L:-1,-1 -1x-1
Content:
Image: <icon>
Alpha: 255

Element: Recording Audio Button/Text
Geometry:
P:0,0 300x52 L:0,0 300x52
Content:
Text: Start Recording Audio
Text Size: 17
Text Width Scale Percent: 100
Text Colour: #FF000000
Position: Centre
Vertical Fit Mode: None
Text Format: Plain Text

Element: Text1/Text
Geometry:
P:7,59 286x171 L:-1,-1 -1x-1
Content:
Text: Text
Text Size: 16
Text Width Scale Percent: 100
Text Colour: #FFFFFFFF
Position: Centre
Vertical Fit Mode: Reduce Text Size
Text Format: Plain Text

Element: Footer/Rectangle
Geometry:
P:0,237 300x13 L:0,237 300x13
Content:
Shader: Vertical
Colour: #FFDDDDDD
End Colour: #FF999999
Border Width: 0
Border Colour: #FF000000
Corner Radius: 9
Rounded Corners: Bottom

Element: Image2/Image
Geometry:
P:73,83 153x125 L:-1,-1 -1x-1
Content:
Image: /storage/sdcard0/Tasker/.icn/Icons/sound_record.png
Alpha: 255
Events:
Click: 92

Rich D

unread,
Mar 25, 2013, 5:10:21 PM3/25/13
to tas...@googlegroups.com

> What must I add to stop the Task once I press the button and make the pop-up close?
>  

You either need to add a 'destroy scene' or 'hide scene' at the end of your button task.  I would recommend the 'destroy scence' for this particular case.

Rich..

Matt R

unread,
Mar 25, 2013, 5:24:39 PM3/25/13
to tas...@googlegroups.com
Could you just use the simpler Tasker action Alert -> Popup Task Buttons?

Matt

ScottS

unread,
Mar 25, 2013, 5:25:04 PM3/25/13
to tas...@googlegroups.com
Thanks @Rich, though neither works; the pop-up continues to show. If I enable 'Continue Task Immediately' on the Show Scene, the Task never shows the Flash, though it closes, immediately, without my intervention. :-)

ScottS

unread,
Mar 25, 2013, 5:27:23 PM3/25/13
to tas...@googlegroups.com
@Matt, I suppose, if the action is different, though I completely suck at Scenes and have no idea how to redesign it for one icon.

Rich D

unread,
Mar 25, 2013, 5:27:51 PM3/25/13
to tas...@googlegroups.com

A few tips for dealing with scenes....

1. If you are using the test button To fire the task that starts the scene, be aware that that task will start at a priority 10. When you go to fire it from a shortcut or widget  it will have whatever priority you have selected in your Tasker preferences.  

2. I always try to remember to name any tasks for my scene elements when first creating the task. After saving the scene for the first time you will no longer be able to name the task for that element.  This will limit what you will be able to do with that task later on down the road.

There is 2 out of most likely at least 100 just to get you headed in the right direction.    :)

Rich..

Rich D

unread,
Mar 25, 2013, 5:38:05 PM3/25/13
to tas...@googlegroups.com

> Thanks @Rich, though neither works; the pop-up continues to show. If I enable 'Continue Task Immediately' on the Show Scene, the Task never shows the Flash, though it closes, immediately, without my intervention. :-)
>

Are you sure you are putting the destroy scene in the button task ( the task that comes up when you press the 'Tap' tab in the scene edit screen and NOT the task that starts  the scence.  

Rich..

--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Message has been deleted

ScottS

unread,
Mar 25, 2013, 6:02:14 PM3/25/13
to tas...@googlegroups.com
Figured it out; I still had 'Continue Task Immediately' enabled, after moving the Destroy Scene Task to the Scene. Thanks for the input.

Rich D

unread,
Mar 25, 2013, 6:08:52 PM3/25/13
to tas...@googlegroups.com

> Figured it out; I still had 'Continue Task Immediately' enabled, after moving the Destroy Scene Task to the Scene. Thanks for the input.
>

No problem.... They can be a real PITA to figure out sometimes...  but usually worth the effort...  

Rich..

ScottS

unread,
Mar 26, 2013, 12:17:32 PM3/26/13
to tas...@googlegroups.com
Something just isn't right with this setup. When I execute the Profile and press the Scene-created button, I notice that both 'Tasks' are running. I understand the record Task would run, but the task which shows the Scene is still running even though the Scene is closed. Also, when the Profile is done and the audio file saved, Tasker indicates there's still an active, hidden Scene. I get the message stating so, and the Scene I created is still shown in green on the Scenes tab. This presents a problem as I cannot run the Profile again until I stop Tasker and restart it.

Is there maybe a better method of constructing this? Below is what I am presently using (minus the scene); I just want a button presented to tap and start the recording, rather the the recording start automatically.

This Profile starts the audio recording and presents a notification:

Record Audio (50)
A1: Auto-Sync [ Set:Off ]
A2: Flash [ Text:Audio recording started Long:Off ]
A3: Notify [ Title:Audio Recording Text:Audio recording in progress Icon:ipack:ilikebuttonshd:cuteball_shutdown Number:0 Permanent:Off Priority:3 ]
A4: Record Audio [ File:/storage/sdcard1/Recordings/%DATE.%TIME Source:Microphone MaxSize:0 Codec:AMR Wideband Format:MP4 ]

This Profile activates when I tap the notification; stops the recording, saves it to SDcard, and opens the respective folder:

Profile: Recording Audio notification (46)

Event: Notification Click [ Owner Application:* Title:Audio Recording ]
Enter: Anon (49)
A1: Record Audio Stop
A2: Auto-Sync [ Set:On ]
A3: Browse Files [ Dir:../sdcard1/Recordings Match: Include Hidden Files:Off ]

Reply all
Reply to author
Forward
0 new messages