Author Topic: Tell the time with limited .mp3 files  (Read 1178 times)

mondoz

  • Guest
Tell the time with limited .mp3 files
« on: May 12, 2019, 05:05:56 PM »
I'd like to have a command that plays numeric .mp3 files to tell the local time. 
I've read about the inline functions and tokens, but I'm limited in the vocal digits I can use. 
I only have "zero" through "nine". So it would end up sounding like "Five three three" (five.mp3 three.mp3 three.mp3), until I can get more .mp3 files for things like "twenty" or "twelve".   
Until then, how can I parse the time token to play these mp3 files according to the time?   
Thanks!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Tell the time with limited .mp3 files
« Reply #1 on: May 12, 2019, 06:04:32 PM »
I take it you're avoiding using text-to-speech on purpose?


If you rename those files this can be done much more elegantly, as you don't have to convert from the numerals the token outputs:
Code: [Select]
Begin Text Compare : [{TXTSUBSTR:"{TIMEHOUR24}":0:1}] Does Not Equal '0'
    Play sound, '{VA_SOUNDS}\{TXTSUBSTR:"{TIMEHOUR24}":0:1}.mp3'  (and wait until it completes)
End Condition
Play sound, '{VA_SOUNDS}\{TXTSUBSTR:"{TIMEHOUR24}":1:1}.mp3'  (and wait until it completes)
Play sound, '{VA_SOUNDS}\{TXTSUBSTR:"{TIMEMINUTE}":0:1}.mp3'  (and wait until it completes)
Play sound, '{VA_SOUNDS}\{TXTSUBSTR:"{TIMEMINUTE}":1:1}.mp3'

E.G. if it's 5:33, it'd play "5.mp3", "3.mp3", and "3.mp3" again; If it's 12:09 it'd play "1.mp3", "2.mp3", "0.mp3", and "9.mp3".

mondoz

  • Guest
Re: Tell the time with limited .mp3 files
« Reply #2 on: May 12, 2019, 06:52:06 PM »
If you rename those files this can be done much more elegantly, as you don't have to convert from the numerals the token outputs:


Ah, I see, yes I'll do just that. 

Thanks very much!!