VoxCommando Forum

Help and Support (Using VoxCommando) => VoxCommando Basics and Core Features => Topic started by: MrWolf on January 15, 2013, 02:25:05 PM

Title: Getting TTS to say the the reported seconds as minutes
Post by: MrWolf on January 15, 2013, 02:25:05 PM
Hi gents,

A while ago you helped me set a nap timer, so that I could say "Wake me up in 10 minutes", or wake me up in "20 minutes"... 

VC.SetEventTimer {1} Alarm

Then we had the following payloads...
600   10 minutes
900   15 minutes
1200   20 minutes
1500   25 minutes
1800   30 minutes
2100   35 minutes
2400   40 minutes
2700   45 minutes
3600   an hour

The issue I have now is that I want be certain I was correctly heard, so I want him to say "I will wake you again in 10 minutes".  So I added the following...

TTS.SpeakSync    I will wake you again in {1} minutes

That works apart from the fact he now says "I will wake you again in 600 minutes".

I thought I would be able to do it by setting up a bunch of Results.Replace commands...

Results.Replace   600   1
Results.Replace   900   15
TTS.SpeakSync    I will wake you again in {1} minutes

That doesn't work, primarily I imagine because I am an uneducated baboon.

Can someone correct my dreadful handy work?

-P
Title: Re: Getting TTS to say the the reported seconds as minutes
Post by: MrWolf on January 15, 2013, 03:08:37 PM
Sorry mate, I still don't see the answer...  I want to make it so that when Vox sees the result "600 seconds" the TTS speaks the words "10 minutes" instead of 600 seconds...

I can get the timer to work fine, I just want it to repeat back to me the command so that I know Vox heard me correctly.

Any help would be greatly appreciated.

-P

Title: Re: Getting TTS to say the the reported seconds as minutes
Post by: jitterjames on January 15, 2013, 04:39:06 PM
Use friendly payloads {pf.1} to get the phrase part of the payload.
Title: Re: Getting TTS to say the the reported seconds as minutes
Post by: jitterjames on January 15, 2013, 04:44:33 PM
Quote from: MrWolf on January 15, 2013, 02:25:05 PM
I thought I would be able to do it by setting up a bunch of Results.Replace commands...

Results.Replace   600   10
Results.Replace   900   15
TTS.SpeakSync    I will wake you again in {1} minutes

That doesn't work, primarily I imagine because I am an uneducated baboon.

if you did want to go this route, it is important to realize that Results.Replace operates on {lastResult}, not on the value of {1}.  So you would first need to put the value of {1} into {lastResult}.  To do that use Results.SetLastResult and use {1} as the parameter.  But for your current task friendly payloads are better.  ^-^

from the action description in VC:
Quote
Performs a replace on {lastresult}

any occurences of <old string> will be replaced with <new string>

the result after replacement is placed back into {lastresult}
Title: Re: Getting TTS to say the the reported seconds as minutes
Post by: MrWolf on January 21, 2013, 03:21:09 PM
As always my friend, you are a genius.  Works great :)

-P