Voice Assistant for portable arms

Advanced techniques applicable to any version of CMM-Manager
Post Reply
Murguel
Frequent User
Frequent User
Posts: 55
Joined: Mon Aug 13, 2018 9:59 am

Voice Assistant for portable arms

Post by Murguel » Fri Oct 19, 2018 5:52 am

I really start to love CMM Manager. Just implemented a voice assistant, what I would like to share with you guys.

For those wo are measuring with protable arms and do not want to permanently watch the Status Bar or Measurement Dialog to see which element comes next:

Code: Select all

SpeakText = "Measure Circle 1 with 4 points without plane "
'
'* The next two rows should exist in the first script.
'* If you want to use this script multiple times, then remove
'* the next two lines in the following scripts
'
Dim sapi
Set sapi=CreateObject("sapi.spvoice")
'
'* This is the main function. This has to remain in all further scripts
'
sapi.Speak SpeakText
Good luck with. For me it is not just a nice gimmick... it really assists during the measurement.

medupriest
SUDO
SUDO
Posts: 423
Joined: Fri Mar 13, 2015 11:59 am

Re: Voice Assistant for portable arms

Post by medupriest » Fri Oct 19, 2018 11:16 am

Very nice. Thank you for the contribution.

User avatar
CrashN8
Site Admin
Site Admin
Posts: 519
Joined: Thu Feb 09, 2017 4:07 pm

Re: Voice Assistant for portable arms

Post by CrashN8 » Mon Oct 22, 2018 11:19 am

This is great! Yes, thank you for the contribution. I will make this post sticky.
Note: You can also change the voice by adding the following line to VBScript:

Set sapi.Voice = sapi.GetVoices.Item(1)

Code: Select all

SpeakText = "Hello World.  This is a voice synthesizer test."
'
'* The next two rows should exist in the first script.
'* If you want to use this script multiple times, then remove
'* the next two lines in the following scripts
'
Dim sapi
Set sapi=CreateObject("sapi.spvoice")
Set sapi.Voice = sapi.GetVoices.Item(1)

'
'* This is the main function. This has to remain in all further scripts
'
sapi.Speak SpeakText

Murguel
Frequent User
Frequent User
Posts: 55
Joined: Mon Aug 13, 2018 9:59 am

Re: Voice Assistant for portable arms

Post by Murguel » Tue Oct 23, 2018 4:33 am

Thank you too. Now I can switch between German and English :) Great.

User avatar
CrashN8
Site Admin
Site Admin
Posts: 519
Joined: Thu Feb 09, 2017 4:07 pm

Re: Voice Assistant for portable arms

Post by CrashN8 » Tue Feb 12, 2019 10:21 pm

Update that includes use of InputBox(), Voice Rate, and Volume:

Code: Select all

dim speechobject
dim response

response = inputbox("Enter Text To Speak")

Set VObj = CreateObject("SAPI.SpVoice")
   with VObj
       Set .voice = .getvoices.item(0)
       .Volume = 100
       .Rate = 1
   end with

set speechobject=VObj
speechobject.speak response

Post Reply