Author Topic: Tell me time.  (Read 1908 times)

LuckyXIII

  • Newbie
  • *
  • Posts: 10
Tell me time.
« on: February 16, 2021, 07:26:27 PM »
Okay so this is along shot and even if could work Im not sure how I would go about it.
So I want the VA to tell me the time, with a recorded voice I can make. Im thinking I need to record all the sounds I want it to say military time 0-23 for hours, and hundred - 59 for minutes. Im sure it will involve text files and reading those files or something. Thats about as far as I have gotten with the thought process.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Tell me time.
« Reply #1 on: February 16, 2021, 07:31:43 PM »
You can use the time tokens to form part of the file name/path, E.G.

Code: [Select]
Play sound, '{VA_SOUNDS}\hour{TIMEHOUR24}.mp3'  (and wait until it completes)
Play sound, '{VA_SOUNDS}\minute{TIMEMINUTE}.mp3'  (and wait until it completes)

No text files (?) involved.
« Last Edit: February 17, 2021, 06:35:13 PM by Pfeil »

LuckyXIII

  • Newbie
  • *
  • Posts: 10
Re: Tell me time.
« Reply #2 on: February 17, 2021, 03:38:46 PM »
Lets say Im a new person. Where would I find how to input these commands?
I can create all the audio files but Im not sure how to make them work. Or to get VA tell me the time.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Tell me time.
« Reply #3 on: February 17, 2021, 03:51:26 PM »
Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer, which contains information on VoiceAttack's features. The "'Play a Sound'" and "Text (and Text-To-Speech) Tokens" sections are particularly relevant to this.

These topics may also be of use:
Control flow (If, Else, ElseIf, Loop, Jump) basics
Variables and tokens summed up


The command shown in the example consists of two "Play a Sound" actions, that use tokens to dynamically build a path to a sound file.

E.G. if you have files named "hour00.mp3" to "hour23.mp3", and "minute00.mp3" to "minute59.mp3" in VoiceAttack's "Sounds" directory, the command should play the ones appropriate for the current time.

LuckyXIII

  • Newbie
  • *
  • Posts: 10
Re: Tell me time.
« Reply #4 on: February 17, 2021, 05:48:21 PM »
Well the jargon used is like speaking another language. I made all the sound files, put them in va/sounds but as far as txt-to-speech goes this is where I get lost.

LuckyXIII

  • Newbie
  • *
  • Posts: 10
Re: Tell me time.
« Reply #5 on: February 17, 2021, 06:10:20 PM »
Okay I just figured out what VA_SOUNDS was, not sure what the \hour{TIMEHOUR24}.mp3 is for, also it just reads off the directory before getting to the time and its still Default David. I just copied and pasted
{VA_SOUNDS}\minute{TIMEMINUTE}.mp3 and it reads it out with the directory and stuff but none of my customized mp3s.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Tell me time.
« Reply #6 on: February 17, 2021, 06:16:13 PM »
  • Click to open the "Edit a Profile" window
  • Click the "New Command" button to open the "Add a Command" window
  • Type in a name/trigger phrase for your command into the "When I say" field
  • Click the "Other >" button
  • Click "Sounds"
  • Click "Play a Sound" to open the "Play a Sound" window
  • In the first field (the white textbox, immediately below the description text), paste "{VA_SOUNDS}\hour{TIMEHOUR24}.mp3" (without the double quotes)
  • Click the "Wait until sound completes before continuing command" label to enable that option (make sure the checkbox to the left of it has a checkmark in it)
  • Click "OK"
  • Click the "Other >" button
  • Click "Sounds"
  • Click "Play a Sound" to open the "Play a Sound" window
  • In the first field (the white textbox, immediately below the description text), paste "{VA_SOUNDS}\minute{TIMEMINUTE}.mp3" (without the double quotes)
  • Click "OK" (whether the "Wait until sound completes before continuing command" option is enabled or not does not matter in this case, as it is the last action in the command)
  • Click "OK" to add the command to the profile
  • Click "Done" to apply the changes to the profile
  • Test the command by speaking the command phrase you chose earlier (the one typed into the "When I say" field)

LuckyXIII

  • Newbie
  • *
  • Posts: 10
Re: Tell me time.
« Reply #7 on: February 17, 2021, 06:24:31 PM »
Figured it out!!! WOOO Thanks, a bit more description would have helped but I figured it out ;D

LuckyXIII

  • Newbie
  • *
  • Posts: 10
Re: Tell me time.
« Reply #8 on: February 17, 2021, 06:32:58 PM »
Wait Im getting an error for the timeminutehour

\Sounds\minuteTIMEHOURMINUTE.mp3 - Sound file doesnt not exist. So "01Minute.mp3"?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Tell me time.
« Reply #9 on: February 17, 2021, 06:34:49 PM »
That should be "{TIMEMINUTE}" (which was a typo on my part, now corrected).

If a token name is not valid, the curly braces are stripped, and the text contained within them remains.

LuckyXIII

  • Newbie
  • *
  • Posts: 10
Re: Tell me time.
« Reply #10 on: February 17, 2021, 06:39:52 PM »
Okay now I have another problem, I can preview it fine, but on doing the command it reverts back to david.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Tell me time.
« Reply #11 on: February 17, 2021, 06:40:42 PM »
What does your action list look like?

Right-click the action list, choose "Copy All as Text" from the context menu, then paste here into a code block (click the # button)

LuckyXIII

  • Newbie
  • *
  • Posts: 10
Re: Tell me time.
« Reply #12 on: February 17, 2021, 06:41:30 PM »
okay, I guess I needed to apply and save. It now reads correctly! Man I appreciate the heart ache!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Tell me time.
« Reply #13 on: February 17, 2021, 06:43:26 PM »
Yes...as mentioned in the provided step-by-step instructions, you need to save the changes to the profile before attempting to observe the effects of said changes.