Author Topic: TTS not starting after monitor-on command  (Read 2919 times)

0 Members and 1 Guest are viewing this topic.

FallenOne

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
  • step by step
    • View Profile
TTS not starting after monitor-on command
« on: November 04, 2013, 03:19:39 PM »
So, hey, i'm the new guy ;)
First of all thank you for making a software i was always looking for!  ;D

Anyways, i'm still new to this, so i'm taking my baby-steps to more and more complex stuff.

the problem i'm encountering atm is as follows:
i leave my pc  (win 7 64 bit), and i programmed the "monitor off" command to.. well, turn off the monitors.

now, when i come back, what i want to happen is i say something like "i'm back", a song comes on, pc tells me the time via tts, as well as the upcoming events from ggcal.

that's the plan. problem it that the tts often does not start to talk. i see that the event is triggered, monitors turn on, music starts, and the osd shows my upcoming events, but the tts won't talk.
i tried tinkering around with pause commands to give the pc time to start up, but the music starts even before the monitors start up so i guess that's not the problem.


hope i described the problem somewhat understandable.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="797" name="monitore an" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="" loopMax="0" description="">
  <action>
    <cmdType>Launch.OpenFile</cmdType>
    <cmdString>C:\Users\Public\Music\Sample Music\Kalimba.mp3</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString>welcome back sir, the time is {shorttime} on {shortdate}. I hope you had a nice day.</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>System.Monitor.On</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>GgCal.GetRange</cmdType>
    <cmdString>0&amp;&amp;7</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.MatchConcat</cmdType>
    <cmdString>{CR}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.AddText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString>Upcoming events: {LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>geh ma an hier</phrase>
</command>


hope to hear from you soon, thanks again.
greetings from germany
FallenOne aka Max

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TTS not starting after monitor-on command
« Reply #1 on: November 04, 2013, 03:47:34 PM »
Hi FallenOne and welcome to VoxCommando.

Thanks for a very well phrased question, and for posting your xml code etc.  It makes it a lot easier and more fun to assist you.  ;D

Does TTS always work OK with other commands when your TV is on, or is that also hit and miss?  My first thought is that perhaps you are using audio through HDMI on your TV and the audio won't work if the TV is turned off.

If the TV is turned on first, it may take a certain amount of time before it is ready to produce audio (e.g. 5-10 seconds maybe).  Whereas the music might keep playing and eventually you can hear it, the TTS might give up right away when it sees no audio output available yet.  I know you tried a pause but maybe you need a longer pause in a non-blocking command.

Anyway let us know what your audio setup is like, does your TTS come through the same speakers as your music etc...

Note: I reread your question and edited this post a bit after my initial response.
« Last Edit: November 04, 2013, 03:51:20 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TTS not starting after monitor-on command
« Reply #2 on: November 04, 2013, 03:54:51 PM »
You can try with this command, and maybe even extend the delay for more than 5 seconds if necessary.

The ++ at the beginning of the command name is a bit of an Easter Egg feature.  It tells VC to run this command multi-threaded, which is generally a bit risky but in this case might help let your audio come back online...

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="797" name="++monitore an" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="" loopMax="0" description="">
  <action>
    <cmdType>System.Monitor.On</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <cmdString>5000</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Launch.OpenFile</cmdType>
    <cmdString>C:\Users\Public\Music\Sample Music\Kalimba.mp3</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString>welcome back sir, the time is {shorttime} on {shortdate}. I hope you had a nice day.</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>GgCal.GetRange</cmdType>
    <cmdString>0&amp;&amp;7</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.MatchConcat</cmdType>
    <cmdString>{CR}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.AddText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString>Upcoming events: {LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>geh ma an hier</phrase>
</command>

FallenOne

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
  • step by step
    • View Profile
Re: TTS not starting after monitor-on command
« Reply #3 on: November 04, 2013, 03:58:52 PM »
--written while you posted, i'll try your code now--

Hey James, thanks for the warm welcome ;)

As i said it's pretty much baby steps.

PC only, sound via normal speakers from the (onboard) sound jacks, no fancy "controlling other stuff" yet ^^

i don't know in what order the systems are brought back up, since the music is playing fine i'd say the sound is working.
tts usually works like a charm since that is the thing i mostly did until now.. you know.. make my pc talk and all =)

also i'm not sure what the monitor-off function really does "behind the scenes". if it only deactivates the monitors (like say the screensaver) i don't really see why tts would have problems with that.

thanks for the fast answer ;)
Max

--Edit:

So, i tried your modification, now what happens is
-Monitors turn on
-bit of a pause
-music plays for ~2 seconds, then goes silent for~5 seconds
-osd displays the "wake up"
-after ~10secs from the initial startup the tts starts with the ggcal message

the first messeage gets lost somewhere
« Last Edit: November 04, 2013, 04:04:30 PM by FallenOne »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TTS not starting after monitor-on command
« Reply #4 on: November 04, 2013, 04:38:26 PM »
Monitor off does whatever normally happens when your monitor goes to sleep as it would after a period of inactivity and this should usually mean the the monitor is actually powered off except for the small amount of standby power required to detect that it needs to turn back on.  If the monitor has audio capabilities (even if you are not using them) it is possible that it is somehow interfering with other audio thingies in windows when the monitor comes back online.  Even if the monitor has no audio capabilities, all bets are off with windows!

This is one of those situations where every machine will probably be different.  On another system this command might work fine.

You can try using the TTS.Speak2Wav action in this situation then since you are able to play audio normally.  Maybe it will work better.
« Last Edit: November 04, 2013, 04:41:48 PM by jitterjames »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TTS not starting after monitor-on command
« Reply #5 on: November 04, 2013, 04:50:09 PM »
Hi FallenOne. Not that it helps you, but I have used your original command and it works perfectly on my W7 64-bit machine. (I love this command by the way! And the Mr. Scruff song is perfect background music for the TTS announcements.)

I have just one monitor. Don't know if that's a factor or not.
« Last Edit: November 04, 2013, 04:52:30 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

FallenOne

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
  • step by step
    • View Profile
Re: TTS not starting after monitor-on command
« Reply #6 on: November 04, 2013, 04:54:40 PM »
soooo.. playing around with this, i now deactivated every audio-output-option there is except my 2 speakers ^^

i tried the tts.speak2wav, did not work :C
i took out the delay, as well as the two ++, monitor off  - monitor on. it's now reading me the events, and appearently tries to say the "welcome" line. in the history that line has a yellowi-ish background color.
i'll now try to move thinge around and add a delay here and there, only for the tts. maybe i'll just put that welcome line into the upcoming events tts line ^^
funny thing is the music starts playing immediately


@nime5ter : glad you like it, and thanks for your input. that idea/functionality is basically what got me started with voxcommando. it's tony stark's fault btw =)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TTS not starting after monitor-on command
« Reply #7 on: November 04, 2013, 05:08:05 PM »
Did you try rolling over the 'welcome' line in the history window? Usually the log displays more information if you roll over it with your mouse. (The orange background indicates some kind of error.)
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

FallenOne

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
  • step by step
    • View Profile
Re: TTS not starting after monitor-on command
« Reply #8 on: November 04, 2013, 05:14:57 PM »
sadly, i did not. i did, however, rearranged some stuff. it now looks like this:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="810" name="monitore an" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="" loopMax="0" description="">
  <action>
    <cmdType>GgCal.GetRange</cmdType>
    <cmdString>0&amp;&amp;7</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>System.Monitor.On</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.MatchConcat</cmdType>
    <cmdString>{CR}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.AddText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString>welcome back sir, the time is {shorttime} on {shortdate}. Upcoming events: {LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Launch.OpenFile</cmdType>
    <cmdString>C:\Users\Public\Music\Sample Music\Kalimba.mp3</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>geh ma an hier</phrase>
</command>

as you can see, i now use only one tts line, wanted more to keep it nice to look at... but screw that ;) also i get the ggcal getrange before i turn the monitors on to make it a bit more instant if the internet may be slow for some reason.


works like a charm. next up, trying to get it to read me some news headlines... but that's a task for tomorrow ;)

thanks for all the help, really looking forward to what i can do (with some help heh) with voxcommando ;)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TTS not starting after monitor-on command
« Reply #9 on: November 04, 2013, 05:29:02 PM »
I still think speak2wav can work for you.  You probably did not play the wav file that was produced.

Here is an example of how to use it:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="1170" name="speak to wav broken" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TTS.Speak2Wav</cmdType>
    <cmdString>this, is a big fat test!&amp;&amp;thing.wav</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Sound.PlayStream</cmdType>
    <cmdString>thing.wav</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TTS not starting after monitor-on command
« Reply #10 on: November 04, 2013, 05:38:29 PM »
Also, if you want the OSD of your upcoming events to last longer, you could use the optional duration parameter of OSD.ShowText.

The way that you've composed your command above, this won't work because you're first showing the number of calendar events, and then adding the list of events. But you could do a workaround, if you like:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="810" name="monitore an2" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="" loopMax="0" description="">
  <action>
    <cmdType>GgCal.GetRange</cmdType>
    <cmdString>0&amp;&amp;7</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>System.Monitor.On</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.MatchConcat</cmdType>
    <cmdString>{CR}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>{#M} events{CR}{LastResult}&amp;&amp;24000</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString>welcome back sir, the time is {shorttime} on {shortdate}. Upcoming events: {LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Launch.OpenFile</cmdType>
    <cmdString>C:\Users\Public\Music\Sample Music\Kalimba.mp3</cmdString>
    <cmdRepeat>0</cmdRepeat>
  </action>
  <phrase>geh ma an hier</phrase>
</command>

Same results, but the OSD stays displayed for 24 seconds (in this example).
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TTS not starting after monitor-on command
« Reply #11 on: November 04, 2013, 05:57:27 PM »
Did you try rolling over the 'welcome' line in the history window? Usually the log displays more information if you roll over it with your mouse. (The orange background indicates some kind of error.)

An orange background means "error" but off-white means it doesn't actually know if it worked or not.

My bad, this usually happens with older actions that have not yet been updated to return an action result.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: TTS not starting after monitor-on command
« Reply #12 on: November 04, 2013, 09:11:49 PM »
Hi FallenOne and welcome to VoxCommdo forum. You can use also the TTS.SpeakSync action instead of TTS.Speak in you command, this allowed VC to speak first the TTS complete before it is execute the next action, maybe this can help you.
***********  get excited and make things  **********

FallenOne

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
  • step by step
    • View Profile
Re: TTS not starting after monitor-on command
« Reply #13 on: November 05, 2013, 03:01:39 AM »
wow, thanks to all the feedback.. so let's see:

james:
Yes, speak2wav does work, i probably really did set that up wrong ;) anyways it's working now.

nime5ter:
that will come in handy =) even thou as of right now i just use that osd for a short reminder from the calendar, so no need to let it stay up that long =)

Kalle:
thanks for the welcome and for another useful command ;)