Is it possible to have TTS say a responses only when a vox prefix alone is said and not when a prefix is combined with a command?
For example:
1.
Me: Computer ( prefix only )
TTS: Yes, I am listening
Me: launch XMBC
TTS: launching XBMC
Vox: execute command.
2.
Me: Computer
TTS: Good evening, I am listening response based on time of day.
Me: launch XBMC
TTS: launching XBMC
Vox: execute command.
3.
Me: Computer launch XMBC - ( prefix + command = greeting is bypassed)
TTS: launching XBMC
Vox: execute command.
TTS will respond with a greeting when only the prefix alone is said but it will not give a greeting when the prefix + command is said, it will just execute the command and give a confirmation.
Yes, it is possible to do that but then you are not actually using a prefix in case 1 and 2. A prefix is where you say the prefix as part of a single sentence.
Based on what you are describing you are simply telling the computer to listen by saying "computer". You can edit the listen command to give a TTS response in addition to going into green mode, and you can change the phrase that triggers the command to include "computer" if it is not already there.
In your 3rd example you are actually using prefix mode. I'm not 100% sure how well it would work if you used the phrase "computer" for both your prefix and your listen command but you can try it.
Response based on time of day is a bit trickier given our current toolset. We can check if {shorttime} contains AM and if so it's morning. Otherwise it could be afternoon or evening. Checking the actual time might be possible but I'm not sure right now how we could do that.
Quote from: jitterjames on October 07, 2011, 04:51:45 PM
Yes, it is possible to do that but then you are not actually using a prefix in case 1 and 2. A prefix is where you say the prefix as part of a single sentence.
Based on what you are describing you are simply telling the computer to listen by saying "computer". You can edit the listen command to give a TTS response in addition to going into green mode, and you can change the phrase that triggers the command to include "computer" if it is not already there.
In your 3rd example you are actually using prefix mode. I'm not 100% sure how well it would work if you used the phrase "computer" for both your prefix and your listen command but you can try it.
Response based on time of day is a bit trickier given our current toolset. We can check if {shorttime} contains AM and if so it's morning. Otherwise it could be afternoon or evening. Checking the actual time might be possible but I'm not sure right now how we could do that.
I am not sure, but with a logic command in command builder like this "if - A contains B - Then - action -Else - action
Kalle
"Based on what you are describing you are simply telling the computer to listen by saying "computer". You can edit the listen command to give a TTS response in addition to going into green mode, and you can change the phrase that triggers the command to include "computer" if it is not already there."
Thank you, I was not clear on the Prefix use, I think I understand now.
So here is what I am trying to do.
I am trying to get TTS to responded when the listen phrase is given but only if the listen phrase is said without any additional commands,
When that happens TTS will add a random response to the listen response. Something like "good morning, I am listening" or " It's 1am, you should be sleeping, how can I assist you"
maybe Vox could randomly pick from a list of responses based on time of day.
And finally, If the listen phrase is given with additional commands, then TTS will only give a confirmation response and not a greeting.
I hope that makes a bit more sense.
Quote from: mparks on October 07, 2011, 03:27:15 PM
Is it possible to have TTS say a responses only when a vox prefix alone is said and not when a prefix is combined with a command?
For example:
1.
Me: Computer ( prefix only )
TTS: Yes, I am listening
Me: launch XMBC
TTS: launching XBMC
Vox: execute command.
2.
Me: Computer
TTS: Good evening, I am listening response based on time of day.
Me: launch XBMC
TTS: launching XBMC
Vox: execute command.
3.
Me: Computer launch XMBC - ( prefix + command = greeting is bypassed)
TTS: launching XBMC
Vox: execute command.
TTS will respond with a greeting when only the prefix alone is said but it will not give a greeting when the prefix + command is said, it will just execute the command and give a confirmation.
Hi mparks, welcome to VC forum.
Here is a solution for your second example:
step 1: save the attached time.vbs in the VC folder or any other place on your computer ;) and the attached "VcGrp_time check.xml" in the export folder of VC
step 2: open the command builder in VC and click "open a new bin file", select the "VcGrp_time check.xml" and click open.
step 3: drag and drop the "time check" group from the right side to the commandtree on the left side. Double-click on the "time check" command and edit the path where do you save the "time.vbs"
Save all and restart VCWhat does the Command? When VC change from standby (yellow) to ON (green), VC welcome you with the correct form of address depending on time.
You can edit the time.vbs in notpad-editor, so VC can say what you want when it switched on.
I hope it help you ;)
Kalle
;D You guys are officially Kings of Kings.
Your responses are extremely fast and you already have a solution, that is so crazy.
I have been playing with Dragon Naturally Speaking over the years and now I am testing out v11.5 pro on a friends computer. It's great for sending emails and using MS office but not as good as Vox for controlling the computer, maybe I just have not figured it out yet.
With Vox, I tired it once and bought it right away, Good work guys.
I am going to go play with this solution and get back you.
Awesome. Thanks for the positive feedback. Dragon Naturally Speaking is great for dictation but I don't think it's really geared towards the multimedia experience or even towards controlling the computer, or doing home automation etc. And then there is the high price tag! I just played with Dragon a bit a couple years ago, so I'm not really sure what it is capable of. Once I figured out that Dragon and MS speech recognition could not do what I wanted, I started to create VoxCommando.
Starting with Kalle's vbs script, I added a bit of randomization to the possible responses.
see the attached file.
Quote from: jitterjames on October 08, 2011, 02:37:26 PM
Starting with Kalle's vbs script, I added a bit of randomization to the possible responses.
see the attached file.
Ha ha, cool, but it was not my script - the script was programmed by member "rudmei" here in forum ;)
I've only found here again and edit it a little bit.
Kalle
Thanks again guys, this is indeed what I had in mind.
???
I am currently having an odd problem with the TTS voice used in the script.
I installed the "Bridget" voice from neo but she does not show up in my windows Voice selection, instead "Brian" from Ivona does which is also installed and is selected as the default
Somehow Vox can see all my installed voices and I have "Bridget" set as the default voice in Vox not "Brian".
Here is the problem, this time script used the voice that windows voice selection has set as default which is "Brian" and not the one that is set as default in vox which is "Bridget"
So now I have two voice active, "Brian" is triggered when I go into listen mode and "Bridget" is used for everything else.
My computer now has an identity complex.
Is there a way to have the script use the default voice selected in Vox and not the one set in the windows Voice selection?
I think you have to use the default windows voice with vbscript.
The issue you have with selection of voices is that windows 64 bit won't show 32 bit voices even though they work fine.
To get around it you can try to run this:
C:\Windows\SysWOW64\Speech\SpeechUX\sapi.cpl
which should give you the same control panel for selecting voices except that 32 bit voices should be available.
I compile voxCommando as a 32 bit application specifically to avoid this problem in VC.
Quote from: mparks on October 08, 2011, 04:07:46 PM
Thanks again guys, this is indeed what I had in mind.
???
I am currently having an odd problem with the TTS voice used in the script.
I installed the "Bridget" voice from neo but she does not show up in my windows Voice selection, instead "Brian" from Ivona does which is also installed and is selected as the default
Somehow Vox can see all my installed voices and I have "Bridget" set as the default voice in Vox not "Brian".
Here is the problem, this time script used the voice that windows voice selection has set as default which is "Brian" and not the one that is set as default in vox which is "Bridget"
So now I have two voice active, "Brian" is triggered when I go into listen mode and "Bridget" is used for everything else.
My computer now has an identity complex.
Is there a way to have the script use the default voice selected in Vox and not the one set in the windows Voice selection?
This is no problem, you can use the "TTS.SetVoiceName" command before trigger the time.vbs - see attached pic
:bonk I have this not tested with time.vbs
that only changes the voice in Vox not in the vbs script.
@jitterjames
"C:\Windows\SysWOW64\Speech\SpeechUX\sapi.cpl"
That did it. I can now select the correct voice and she is happy again. No more gender confusion.
How about this for an idea while still on the same subject.
I am thing of modifying the time script to give more ranges in the times like maybe break it down into 30 min increments.
something like ( If time is between 13:00 and 13:30 say this, this or this. IF time is between 14:00 and 14:30 say this, this or this ) and so on. Then randomize the responses a bit more between those 30 min increments
I think that will give it more of an unpredictable feel.
would doing this slow things down? is there some kind of limit that will cause a response lag or side effect?
you should be able to go crazy with it and you won't notice any extra time delay. Give it a shot.
Perfect, now lets see how many unique responses I can come up with. ;)
Hi, guys.
I am in need of help with two vbscript coding.
I have broken the time script down into hourly increments and within each hour Vox has 3 greetings to choose from.
Code:
elseif hour(now)<6 then
if (myrand=1) then
ttsmessage = "good morning, It's" & time & ", why are you up?"
elseif (myrand=2) then
ttsmessage = "Hi, How can I assist you this morning"
else
ttsmessage = "good morning."
end if
The code works fine but & time & gives me the full time format. HH:MM:SS which includes the seconds. How do I remove the seconds so that I only get hours and minuets.
Question #2:
I would also like the greetings to depend on the Day of the week:
So if the time is 6am and the day of the week is between Monday and Friday then say this, this or this
but if the time is 6am and the day is Saturday or Someday then say this, this or this.
Thanks again.
none of us is an expert in vbscript as far as I know. At this point I would recommend that you do some google searches to find some resources on this topic.
Looking at the exising script we are using hour(now), in our if-then-else, to get the hour so I assume we can do something similar for minutes. The other option would be to see if vbscript has some string methods that would allow us to strip the end off of the HH:MM:SS
Thanks jitterjames,
I found a few sources I am currently researching, I will update you guys if i solve it.
Quote from: mparks on October 10, 2011, 04:51:13 PM
Thanks jitterjames,
I found a few sources I am currently researching, I will update you guys if i solve it.
You can also write a PM to member "rudmei" I'm sure he can help you with VBS-scripting.
Kalle
I appreciate that this is an old thread but it pointed me in the right direction so I figured I'd share a couple of things I added:
In this particular script I turn my outside speakers on using VC and EventGhost. Once the speakers are on Bob (there's no "Jarvis" in my house..) announces that they have been turned on. The problem I had with the script as it was is that Bobs volume was set to 100% which effectively meant he yelled that the speakers were on! :o and if music was playing when I gave the command to turn the speakers on it wasn't muted while Bob was talking.
So firstly I set up a Global Hot Key in MediaMonkey (Cntrl+Shift+M) to mute/unmute the sound. Then I added this to the top and bottom of the script:
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "^+{M}"
Then to stop Bob yelling I added the following which sets the TTS volume and rate. NOTE: These settings only apply to the announcements Bob makes in this script - I use other commands to tell Bob to speak up or stop yelling if I want to change the VC's TTS level:
Dim sapi,ttsmeassage
set sapi = CreateObject("sapi.spvoice")
with sapi
Set .voice = .getvoices.item(0)
.Volume = 15
.Rate = 1
end with
So the whole thing looks like this:
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "^+{M}"
Dim sapi,ttsmeassage
set sapi = CreateObject("sapi.spvoice")
with sapi
Set .voice = .getvoices.item(0)
.Volume = 15
.Rate = 1
end with
Randomize
myrand = Int((3)*Rnd+1)
if hour(now)<6 then
ttsmessage = "wow, your up early David! The outside speakers are now on"
elseif hour(now)<12 then
ttsmessage = "Good morning David, The outside speakers are now on"
elseif hour(now)<17 then
ttsmessage = "Good after noon David. The outside speakers are now on"
elseif hour(now)<22 then
ttsmessage = "Good evening David. The outside speakers are now on"
else
ttsmessage = "Good evening David, isn't it past your bed time? The outside speakers are now on"
end if
sapi.Speak ttsmessage
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "^+{M}"
Ideally I would like to use a "softmute" option rather than having to fully mute MediaMonkey but I haven't found a way to do that. I tried using nircmd.exe but that didn't give me what I wanted either because I couldn't "unmute" to the previous volume level. Anyone got any ideas?
Cheers
It is relatively straightforward to do all this using only VoxCommando actions, except for the part where you turn your speakers on which I assume is handled by EventGhost.
I'm not sure how you would do a softmute using only VBScript though.
Something like this... although it might need a snick of debugging...
<?xml version="1.0" encoding="utf-16"?>
<command id="195" name="outdoor speakers on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>EventGhost.Send</cmdType>
<cmdString>turn.outdoorSpeakers.on</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>MM.SoftMute</cmdType>
<cmdString>20</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SetVoiceName</cmdType>
<cmdString>Paul</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SetVolume</cmdType>
<cmdString>20</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)Contains(B)</ifType>
<ifParams>03,04,05,06&&{DtCustom.HH}</ifParams>
<then>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>wow, you're up early David!</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)Contains(B)</ifType>
<ifParams>11,10,09,08,07&&{DtCustom.HH}</ifParams>
<then>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>Good morning David.</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)Contains(B)</ifType>
<ifParams>17,16,15,14,13,12&&{DtCustom.HH}</ifParams>
<then>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>Good afternoon David. Speakers are now on</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)Contains(B)</ifType>
<ifParams>18,19,20,21&&{DtCustom.HH}</ifParams>
<then>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>Good evening David, isn't it past your bed time? </cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>The outside speakers are now on</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)Contains(B)</ifType>
<ifParams>22,23,00,01,02&&{DtCustom.HH}</ifParams>
<then>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>Wow, David, you're up late. Isn't it past your bedtime?</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<action>
<cmdType>MM.SoftUnmute</cmdType>
<cmdString />
<cmdRepeat>1</cmdRepeat>
</action>
</command>
[Edited xml to fix James's booboos. ;)]
though I am an X vb guy ...
I was wondering if this can be done using python to return an hour number (3, 6, 12 etc.) then use that to fetch what tts says from a payload xml, where multiple phrases separated by commas that will give random sentences ?
In fact I was planning on digging how to do it ... but just feeling lazy to lear python ::zzz
In this case, there's no need to use either VB or Python to accomplish what you're describing, so the main reason to do so would be because you actually want to learn Python. ::)
James's xml above gives an example of how to issue different TTS announcements depending on the time. And if you look at the documentation on TTS actions, you'll see that getting random TTS responses is very simple.
Another nice way to do it would be to use payloadXML files as you suggest, but you really don't need python for this.
I have boiled this down to just 2 actions for the greeting. You could add the other stuff back in for the speakers and the softmute if you want.
<?xml version="1.0" encoding="utf-16"?>
<command id="431" name="tts based on time of day" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PayloadXML.GetPhrase</cmdType>
<cmdString>payloads\timebasedgreetings.xml&&{DtCustom.HH}&&Random</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>{LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>{LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</command>
I am also attaching a sample payloadXML file which should be saved in the ".\payloads" subfolder of your VC folder.
Hi James
This solution works great here, thanks :) Bob won't be saying "top of the morning" to me though lol - I take it you've got a bit of Irish blood?? ;D
After my last few attempts (and hours spent) trying to nut things out myself only to have you guys come up with a more eloquent solution to do what I have done I think I'll have to switch to just asking how to do "such and such" ::hmm
Thanks again!
Quote from: Bleazle on May 01, 2014, 03:44:06 AM
After my last few attempts (and hours spent) trying to nut things out myself only to have you guys come up with a more eloquent solution to do what I have done I think I'll have to switch to just asking how to do "such and such" ::hmm
Ha. Please, keep on innovating. Inventing a new command or automation solution is at least half the fun, isn't it?
What's great (imho) about the forum is having different users demonstrating multiple solutions. It helps everyone to see the flexibility of the program, and even if an approach turns out to be not the most powerful solution for one particular challenge, it might be just the ticket to helping someone sort out something else.
... Also, you needn't assume that it's only taking James a couple minutes to come up with his solutions. Believe me, *endless* hours are spent around here, trying to come up with the best possible solutions to various user challenges. The more brains on the case, the better! :biglaugh