Author Topic: Getting TTS to say the the reported seconds as minutes  (Read 1817 times)

0 Members and 1 Guest are viewing this topic.

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Getting TTS to say the the reported seconds as minutes
« 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
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Getting TTS to say the the reported seconds as minutes
« Reply #1 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

Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Getting TTS to say the the reported seconds as minutes
« Reply #2 on: January 15, 2013, 04:39:06 PM »
Use friendly payloads {pf.1} to get the phrase part of the payload.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Getting TTS to say the the reported seconds as minutes
« Reply #3 on: January 15, 2013, 04:44:33 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}

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Getting TTS to say the the reported seconds as minutes
« Reply #4 on: January 21, 2013, 03:21:09 PM »
As always my friend, you are a genius.  Works great :)

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb