Quick Calendar Script - Speech-to-Text

349 views
Skip to first unread message

baudi

unread,
Nov 21, 2010, 8:16:13 PM11/21/10
to Tasker
I've written a python script that allows you to use either Speech-To-
Text or a passed parameter to create a Google Calendar entry. Here's a
link to the wiki entry: http://tasker.wikidot.com/quickcalendar

The script uses the Google Calendar QuickAdd feature. For more about
QuickAdd, click this link http://www.google.com/support/calendar/bin/answer.py?hl=en&answer=36604

David Korn

unread,
Nov 23, 2010, 5:33:42 PM11/23/10
to Tasker
This works pretty great, thanks! I've been wanting something like
this for a long time! A couple ideas that might make it even better:
It would be nice if it offered the chance to re-speak the speech input
if the first interpretation wasn't right. Also I would like a
confirmation flashed once the entry was actually confirmed as added to
my calendar, since it seems like that's a step after speech
confirmation, and I'm not sure how I would know if it failed. Some
kind of "working...please wait" message would be great too, as my
phone is taking a little while to run this all the way through and it
seems hard to tell if it is still working.

I haven't done anything with python scripting or sl4a, but this script
does whet my appetite. :-) I'd love to create more voice-only
interactions with android. Do you happen to know if we can we do text-
to-speech within a script as well? And is it possible to use Tasker's
Record Audio action to capture a sound sample and then use the Google
feature to convert it to text without the normal Google voice
prompt?

Thanks again for sharing this script and for any insights into
expanding it.

baudi

unread,
Nov 23, 2010, 6:23:30 PM11/23/10
to Tasker
On Nov 23, 5:33 pm, David Korn <david.k...@gmail.com> wrote:
> This works pretty great, thanks!  

You're welcome.

>I've been wanting something like
> this for a long time!  A couple ideas that might make it even better:
> It would be nice if it offered the chance to re-speak the speech input
> if the first interpretation wasn't right.  

I figured you could edit with the keyboard if it's not right. If it
gets it wrong once, it may get it wrong again. Anyway, you have the
script and you can change it to do anything you like.

>Also I would like a
> confirmation flashed once the entry was actually confirmed as added to
> my calendar, since it seems like that's a step after speech
> confirmation, and I'm not sure how I would know if it failed.  

When you are presented with the OK/Edit dialog, the entry has already
been made. If it doesn't present that dialog, then it failed.

> Some
> kind of "working...please wait" message would be great too, as my
> phone is taking a little while to run this all the way through and it
> seems hard to tell if it is still working.

Probably a good idea. Both the speech-to-text and the calendar entry
are done with Google web services, so the delay is a little
unpredictable and depends on your current network connection speed.

>
> I haven't done anything with python scripting or sl4a, but this script
> does whet my appetite. :-)  I'd love to create more voice-only
> interactions with android. Do you happen to know if we can we do text-
> to-speech within a script as well?  

Yes, it is. Check here for all the Android-type actions you can do:
http://code.google.com/p/android-scripting/wiki/ApiReference

> And is it possible to use Tasker's
> Record Audio action to capture a sound sample and then use the Google
> feature to convert it to text without the normal Google voice
> prompt?

Nope. That's not possible as far as I've been able to determine. You
can either record or do speech-to-text, not both.

> Thanks again for sharing this script and for any insights into
> expanding it.

I'll probably add a few things to it over the weekend -- mainly error
checking and reporting, and maybe the "Working" dialog that you
suggest.

If you want to learn Python and SL4A, you might check out this post on
the SL4A forum. It's by the author of the brand new "Head First
Python". http://groups.google.com/group/android-scripting/browse_thread/thread/397c8b6f63bdcf3c#

Hagure

unread,
Dec 13, 2010, 7:35:45 AM12/13/10
to Tasker
Finally got around to implementing it.

Works great! Thank you!

baudi

unread,
Dec 13, 2010, 9:41:48 AM12/13/10
to Tasker
You're welcome.

I still plan on improving it a little. When I do, I'll announce it on
this thread.

John

unread,
Jan 16, 2011, 12:19:32 PM1/16/11
to Tasker
I bought Tasker today and needless to say, a monster killer app. would
really appreciate someone helping me out.
It's concerning the calendar.

I have to set my flight schedule every month and it gets tiring to
type it up everytime. The insert calendar task with the in/for was too
basic and not useful. I was thinking of a way to use Speech-to-Text to
say something like "10 february, Rome, 10 AM to 5 PM".

I don't know how to use this script though.
after loading the script in task, what do I write in the pass
variables, %EMAIL_USER or the username itself?
and I press test later and nothing happens. when should I start to
talk, and what to say :D
thanks

John

unread,
Jan 16, 2011, 12:13:33 PM1/16/11
to Tasker
Hi,
I bought Tasker today and needless to say, a monster killer app. would
really appreciate someone helping me out.
It's concerning the calendar.

I have to set my flight schedule every month and it gets tiring to
type it up everytime. The insert calendar task with the in/for was too
basic and not useful. I was thinking of a way to use Speech-to-Text to
say something like "10 february, Rome, 10 AM to 5 PM".

I can't get it to work mainly because I bought the program today and
still learning.
But I have not understood how to use this script I guess.
I load this script in a task, and what should I write in the pass
variables section?
Should I write "%EMAIL_USER" or my actual username?
and I click Test and nothing happens, when should I start talking?
thanks

baudi

unread,
Jan 16, 2011, 12:57:37 PM1/16/11
to Tasker

myr...@gmail.com

unread,
Feb 7, 2011, 4:41:32 PM2/7/11
to tas...@googlegroups.com
I downloaded the script, and nothing happened when I ran it from Tasker. So I modified it to not require external parameters, and ran it internally; the script is dropping a warning about a deprecated object, but never even getting to the point where it opens the Calendar object (the potentially infinite While loop just after the imports). Nor is it failing in the While loop. As far as I can tell, it's dying and exiting (with no error on the terminal screen) before it even reaches the first loop.

SL4A r3, Nexus S. The public SL4A alpha release from the homepage, not a current build.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages