Author Topic: Extended Conversation  (Read 3744 times)

0 Members and 1 Guest are viewing this topic.

rudmei

  • $upporter
  • Jr. Member
  • *****
  • Posts: 4
  • Karma: 0
    • View Profile
    • Tenkara Einfach Fliegenfischen
Extended Conversation
« on: September 17, 2010, 04:37:32 AM »
I love it! I got a german female voice and with the tts feature of VoxCommande she (my computer) has always the final say - I call it a "real life simulation"  ;)

The enhancement is that tts can also be controlled by other applications and scripts.
For example, it is very easy to let your computer talk to you by a VBScript:

Code: [Select]

Dim sapi,ttsmessage
set sapi = CreateObject("sapi.spvoice")

'---------------------------------------------------
'
'put your code here and fill the variable ttsmessage
'
'e.g. ttsmessage = "here I am."
'
'---------------------------------------------------

sapi.Speak ttsmessage


Save the script and in VoxCommando you only have to use the command 'launch' with the path and filname of your script
« Last Edit: October 01, 2010, 03:14:14 AM by rudmei »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Extended Conversation
« Reply #1 on: September 17, 2010, 08:22:42 AM »
Nice ;D. This would be particularly useful if we could pass command line parameters to the vbscript and then use them as variables.  Do you know how to do that?  That way for example, if Vox requested a bunch of now playing information from WMC (or XBMC etc) we could pass it to the vbscript and then you could do whatever you want with it.

btw, I will be including some ready to use variables in the next version of VoxCommando such as {shorttime} {longdate} etc. but the scripting call still be very useful for some people because it gives you full control over how you want to manipulate your data.

I did look into including a vbscript capability within VC, but it was too complicated.  Maybe one day  I will take another look, or perhaps there is a way to integrate python which would be even better (In my opinion).

rudmei

  • $upporter
  • Jr. Member
  • *****
  • Posts: 4
  • Karma: 0
    • View Profile
    • Tenkara Einfach Fliegenfischen
Re: Extended Conversation
« Reply #2 on: September 17, 2010, 09:37:10 AM »
This would be particularly useful if we could pass command line parameters to the vbscript and then use them as variables.  Do you know how to do that?  That way for example, if Vox requested a bunch of now playing information from WMC (or XBMC etc) we could pass it to the vbscript and then you could do whatever you want with it.

Oh, yes! Look at my posting http://voxcommando.com/forum/index.php?topic=73.0. It's a small calculator where VoxCommando passes "numbers and an operator" as parameter to the VBScript. The script evaluates the parameters and "tells" the (hopefully right) result...

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Extended Conversation
« Reply #3 on: September 17, 2010, 11:00:53 AM »
SWEET!  You've got me excited now.  VBScript is much more powerful than it appear at first glance.

so the key to accessing the command line parameters is:

WScript.Arguments

which would be an array I guess, based on spaces between words?  So if you used the command line argument:

what month is it?

WScript.Arguments would be equal to ["what","month","is","it?"]  does that sound correct?

and if you surrounded your argument with quotes,  would it come through as a single element in the array?

I also notice that you use a for next loop, which is fine, but I like to use For Each loops when going through a list of items mostly because it is easier to read.

e.g.:

For Each arg In WScript.Arguments
    ...do something with arg
Next