TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Patrick_35 on January 17, 2007, 07:42:04 AM

Title: Do you want autocad speak ?
Post by: Patrick_35 on January 17, 2007, 07:42:04 AM
Hi
Just for the fun  :-)

Code: [Select]
(setq sapi (vlax-create-object "Sapi.SpVoice"))
(vlax-invoke sapi "Speak" "Do you want autocad speak ?" 0)
(vlax-release-object sapi)

@+
Title: Re: Do you want autocad speak ?
Post by: Guest on January 17, 2007, 09:16:42 AM
Hehehe... kinda cool!
Title: Re: Do you want autocad speak ?
Post by: JohnK on January 17, 2007, 10:06:53 AM
*lol* Awesome!

  (setq sapi (vlax-create-object "Sapi.SpVoice"))
  (vlax-invoke sapi "Speak" "Would you like to play a game ?" 0)
  (vlax-release-object sapi)
Title: Re: Do you want autocad speak ?
Post by: Guest on January 17, 2007, 10:22:04 AM
'Flush the bombers, get the subs in launch mode. We are at DEFCON 1!'
Title: Re: Do you want autocad speak ?
Post by: Dommy2Hotty on January 17, 2007, 10:23:25 AM
Code: [Select]
(DEFUN c:SAPI ()
  (setq sapi (vlax-create-object "Sapi.SpVoice"))
  (vlax-invoke sapi "Speak" "Would you like to play Global Thermo Nuclear War ?" 0)
  (vlax-release-object sapi)
  )
Title: Re: Do you want autocad speak ?
Post by: Krushert on January 17, 2007, 10:33:03 AM
Code: [Select]
(DEFUN c:SAPI ()
  (setq sapi (vlax-create-object "Sapi.SpVoice"))
  (vlax-invoke sapi "Speak" "Would you like to play Global Thermo Nuclear War ?" 0)
  (vlax-release-object sapi)
  )

Cool. 
At first it did not work.  But then realize that the speakers where turn off.  Dooh!   :oops:

BTW,
 Can a klaxon sound of a Navy sub be incorporated?
Woot. DIVE!  Woot. DIVE!  Woot. DIVE!
Title: Re: Do you want autocad speak ?
Post by: iliekater on January 17, 2007, 01:16:56 PM
Ohhhhheeee ... Ha ha ha !   :lmao:

I couldn't hold my belly due to such a loughing !

But , tell me , what is it based on ?
Title: Re: Do you want autocad speak ?
Post by: Josh Nieman on January 17, 2007, 01:32:04 PM
hahahhaha.

awesome fun.


....god I'm a geek.
Title: Re: Do you want autocad speak ?
Post by: Krushert on January 17, 2007, 01:45:42 PM
....god I'm a geek.
First step to recovery is admittance.
 :-D :-)
Title: Re: Do you want autocad speak ?
Post by: SomeCallMeDave on January 17, 2007, 01:56:33 PM
Very cool Patrick.  Thanks for posting.

Now, lets have some fun  :)

Code: [Select]
(defun c:SpeakLayers()
    (setq layList (list (cdr (assoc 2 (tblnext "LAYER" T)))))
    (while (setq layName (cdr (assoc 2 (tblnext "LAYER"))))
       (setq LayList  (append LayList (list layname)))
     )
     (setq sapi (vlax-create-object "Sapi.SpVoice"))
     (mapcar '(lambda(x) (vlax-invoke sapi "Speak" x 0)) layList)
     (vlax-release-object sapi)
 )

But don't try this in a big drawing.  Neither Control-C or Esc will halt execution.
Title: Re: Do you want autocad speak ?
Post by: Krushert on January 17, 2007, 02:22:27 PM
Very cool Patrick.  Thanks for posting.

Now, lets have some fun  :)

Code: [Select]
(defun c:SpeakLayers()
    (setq layList (list (cdr (assoc 2 (tblnext "LAYER" T)))))
    (while (setq layName (cdr (assoc 2 (tblnext "LAYER"))))
       (setq LayList  (append LayList (list layname)))
     )
     (setq sapi (vlax-create-object "Sapi.SpVoice"))
     (mapcar '(lambda(x) (vlax-invoke sapi "Speak" x 0)) layList)
     (vlax-release-object sapi)
 )

But don't try this in a big drawing.  Neither Control-C or Esc will halt execution.


The evil side takes over.  :evil:

Add the words "Deleting all objects on Layer [what]."  Then install it on coworkers computer.
Title: Re: Do you want autocad speak ?
Post by: CECE_CAD on January 17, 2007, 02:25:56 PM
That is really funny!
Title: Re: Do you want autocad speak ?
Post by: T.Willey on January 17, 2007, 02:27:08 PM
Very cool Patrick.  Thanks for posting.

Now, lets have some fun  :)

Code: [Select]
(defun c:SpeakLayers()
    (setq layList (list (cdr (assoc 2 (tblnext "LAYER" T)))))
    (while (setq layName (cdr (assoc 2 (tblnext "LAYER"))))
       (setq LayList  (append LayList (list layname)))
     )
     (setq sapi (vlax-create-object "Sapi.SpVoice"))
     (mapcar '(lambda(x) (vlax-invoke sapi "Speak" x 0)) layList)
     (vlax-release-object sapi)
 )

But don't try this in a big drawing.  Neither Control-C or Esc will halt execution.


The evil side takes over.  :evil:

Add the words "Deleting all objects on Layer [what]."  Then install it on coworkers computer.
or
Add a delay between the sayings, and then add the works
"Deleting all objects one layer x unless you yell stop"
Then after the wait say.
"Didn't hear you, proceeding with deletion."
Title: Re: Do you want autocad speak ?
Post by: Guest on January 17, 2007, 02:49:10 PM
Well this thread certainly got the creative juices flowing...

Let's have some fun with the MS Agent as well!
Title: Re: Do you want autocad speak ?
Post by: CECE_CAD on January 17, 2007, 03:06:56 PM
Never used MS Agent..What does it do and how do you use it?
Title: Re: Do you want autocad speak ?
Post by: Tramber on January 17, 2007, 03:11:13 PM
Matt W !

I'm disappointed because if I type in X=0 and Y=123, he doesn't go to the GCS at the appropriate coordinates  :wink:
Title: Re: Do you want autocad speak ?
Post by: Guest on January 17, 2007, 03:12:48 PM
GCS?  :?  The Glasgow Coma Score??!
Title: Re: Do you want autocad speak ?
Post by: JohnK on January 17, 2007, 04:14:56 PM
Im still playing around with the speaking part... *lol*

there's an easter egg in there (that's why its compiled.) *lol*
Title: Re: Do you want autocad speak ?
Post by: daron on January 17, 2007, 05:01:50 PM
For those that are playing with this utility. If you have trouble understanding the voice, add commas. The voice recognizes commas and will pause. It does help to clarify words. This is pretty cool by the way. I'm setting up a function that will tell me a selected object name and layer.
Title: Re: Do you want autocad speak ?
Post by: Birdy on January 17, 2007, 05:11:49 PM
wow.
I'm gonna have some fun tomorrow.
 :evil:
Title: Re: Do you want autocad speak ?
Post by: Tramber on January 18, 2007, 02:45:04 AM
GCS?  :?  The Glasgow Coma Score??!

Global Coordinates System ? How do you spell it ? In my country, it is named SCG.

Well I was just saying that it would have been funny to see Merlin going to the real Acad ModelSpace coordinates  ;-)
Title: Re: Do you want autocad speak ?
Post by: Patrick_35 on January 18, 2007, 03:40:06 AM
If you have a colleague whom you do not love too much  ^-^

Code: [Select]
(defun autocad_qui_parle (texte / sapi)
  (setq sapi (vlax-create-object "Sapi.SpVoice"))
  (vlax-invoke sapi "Speak" texte 0)
  (vlax-release-object sapi)
)

(defun autocad_qui_parle_debut (rea cde)
  (autocad_qui_parle (strcat "Your command ," (car cde) " will start"))
)

(defun autocad_qui_parle_inconnu (rea cde)
  (autocad_qui_parle (strcat "unknown command ," (car cde)))
)

(defun autocad_qui_parle_cancel (rea cde)
  (autocad_qui_parle (strcat "The command ," (car cde) " as cancelled"))
)

(defun autocad_qui_parle_failed (rea cde)
  (autocad_qui_parle (strcat "The command ," (car cde) " as failed"))
)

(defun autocad_qui_parle_fin (rea cde)
  (autocad_qui_parle (strcat "The command ," (car cde) " as ended"))
)

(if (not pourrir_la_vie)
  (setq pourrir_la_vie (vlr-command-reactor nil (list (cons :vlr-commandWillStart (function autocad_qui_parle_debut))
        (cons :vlr-unknownCommand   (function autocad_qui_parle_inconnu))
        (cons :vlr-commandCancelled (function autocad_qui_parle_cancel))
        (cons :vlr-commandFailed    (function autocad_qui_parle_failed))
        (cons :vlr-commandEnded     (function autocad_qui_parle_fin))
)
         )
  )
)
(princ)

@+
Title: Re: Do you want autocad speak ?
Post by: Maverick® on January 18, 2007, 09:25:16 AM
Add a delay between the sayings, and then add the works
"Deleting all objects one layer x unless you yell stop"
Then after the wait say.
"Didn't hear you, proceeding with deletion."

 :lmao: :lmao: :evil:

I wish I used Autocad now
Title: Do you want autocad to speak?
Post by: terrycadd on January 18, 2007, 10:26:54 AM
We've created a monster! Everyone in the office is running this one, and it's driving the boss crazy.
Code: [Select]
(defun c:SayIt (/ Phrase$ Sapi)
  (if (setq Phrase$ (getstring "\nEnter phrase: " t))
    (progn
      (setq Sapi (vlax-create-object "Sapi.SpVoice"))
      (vlax-invoke Sapi "Speak" Phrase$ 0)
      (vlax-release-object Sapi)
    );progn
  );if
  (princ)
);defun c:SayIt
Title: Re: Do you want autocad speak ?
Post by: Lin-Z on January 18, 2007, 10:41:38 AM
If you have a colleague whom you do not love too much  ^-^


Ummmm.. is it supposed to actually say  the comma?  "Your command comma line has started..."  Yes I'm smart enough to remove the commas, but I thought it was a pause.  Is my computer possessed again?  :evil:
Title: Re: Do you want autocad speak ?
Post by: Patrick_35 on January 18, 2007, 10:59:26 AM
Yes, the comma is a small pause

My colleague will need his gri-gri  :evil:

@+
Title: Re: Do you want autocad speak ?
Post by: Lin-Z on January 18, 2007, 11:11:13 AM
My comma says 'comma' .  In fact is says all the symbols including tilde.   :? 
Title: Re: Do you want autocad speak ?
Post by: CottageCGirl on January 18, 2007, 02:53:55 PM
....god I'm a geek.
First step to recovery is admittance.
 :-D :-)


Is this the moment...?
http://www.theswamp.org/index.php?topic=14563.0
Title: Re: Do you want autocad speak ?
Post by: daron on January 18, 2007, 03:05:24 PM
You're not supposed to spell comma, just put one in.  :-D
Title: Re: Do you want autocad speak ?
Post by: Lin-Z on January 18, 2007, 03:31:12 PM
You're not supposed to spell comma, just put one in.  :-D

Now see a-huyre!   :pissed:  I mean, let me clarify  :angel: :  "Your command , line..."  Actually says "Your command comma line..."  I guess I should point out I'm running it in Map 3D 07 if that makes a difference
Title: Re: Do you want autocad speak ?
Post by: Greg B on January 18, 2007, 05:06:59 PM
Lin-Z

don't put a space between command and the comma.


"Your command, line..."
Title: Re: Do you want autocad speak ?
Post by: Lin-Z on January 18, 2007, 05:51:06 PM
Ohhhhhhhh, I guess I should pay closer attention when I copy/paste code.  All fixed.   :ugly:
Title: Re: Do you want autocad speak ?
Post by: Greg B on January 18, 2007, 05:55:49 PM
You are mightily welcome!
Title: Re: Do you want autocad speak ?
Post by: daron on January 18, 2007, 06:51:16 PM
Thanks Greg. I wouldn't have seen that. Very interesting stuff.
Title: Re: Do you want autocad speak ?
Post by: ronjonp on January 18, 2007, 09:12:34 PM
OK....so how would one query if the user has the speakers mute set, turn the volume to high, and then return it back to the previous settings?
Title: Re: Do you want autocad speak ?
Post by: Big G on January 18, 2007, 10:29:42 PM
hahaha love this!!!

can it be made to speak every command as its being typed on the keyboard?
Title: Re: Do you want autocad speak ?
Post by: Big G on January 18, 2007, 11:02:08 PM
Guess Who??

Code: [Select]
(DEFUN c:who ()
  (setq who (vlax-create-object "sapi.SpVoice"))
  (vlax-invoke who "Speak" "For Centuries, mankind has been trying to unravel the mysteries of the universe" 0)
  (vlax-release-object who)
  )

can you tell its nearly quitting time on a friday?
Title: Do you want autocad to speak?
Post by: terrycadd on January 18, 2007, 11:58:42 PM
Here is a function version that makes it easier to use in programming.  For my *error* function, I included:
(SayIt "Houston, we have a problem!").  Have you tried numbers yet?  It's awesome!  You have to type in "inches" and "feet" etc.  I haven't tested it while a dialog is active, but I will tomorrow.
Code: [Select]
(defun SayIt (Phrase$ / Sapi)
  (setq Sapi (vlax-create-object "Sapi.SpVoice"))
  (vlax-invoke Sapi "Speak" Phrase$ 0)
  (vlax-release-object Sapi)
  (princ)
);defun SayIt
Title: Re: Do you want autocad speak ?
Post by: Krushert on January 19, 2007, 08:09:38 AM
OK....so how would one query if the user has the speakers mute set, turn the volume to high, and then return it back to the previous settings?

Or how about turning the monitor off.

"This file will self destruct in 5 seconds." 
Then the monitor goes black
Title: Re: Do you want autocad to speak?
Post by: CADaver on January 19, 2007, 08:17:24 AM
Have you tried numbers yet?  It's awesome!  You have to type in "inches" and "feet" etc. 
Try this:
3102880657' 6 7/8"
with a space between the foot mark and the six and another between the six and the three.
Title: Re: Do you want autocad speak ?
Post by: Patrick_35 on January 19, 2007, 08:56:57 AM
OK....so how would one query if the user has the speakers mute set, turn the volume to high, and then return it back to the previous settings?

Or how about turning the monitor off.

"This file will self destruct in 5 seconds." 
Then the monitor goes black

Yes, or you can do that

Code: [Select]
(setq sh (vlax-create-object "shell.application")
(vlax-invoke sh 'ShutdownWindows)

@+
Title: Re: Do you want autocad speak ?
Post by: HofCAD on January 22, 2007, 02:55:52 AM
Dear Patrick_35 and Readers,

Question,  can I also change the voice?

Regards,
HofCAD CSI.


Code: [Select]
(defun C:speakcfg(/ @volume @rate)
(setq sapi (vlax-create-object "Sapi.SpVoice"))
(setq @volume (vlax-get-property sapi 'volume))
(vlax-put-property sapi 'volume 10)
(vlax-invoke sapi "Speak" "Do you want autocad speak with a soft volume" 0)
(vlax-put-property sapi 'volume 50)
(vlax-invoke sapi "Speak" "Do you want autocad to speak with a medium volume?" 0)
(vlax-put-property sapi 'volume 100)
(vlax-invoke sapi "Speak" "Do you want autocad to speak with a loud volume?" 0)
(vlax-put-property sapi 'volume @volume)
(setq @rate (vlax-get-property sapi 'rate))
(vlax-put-property sapi 'rate -8)
(vlax-invoke sapi "Speak" "Do you want autocad to speak with a slow rate?" 0)
(vlax-put-property sapi 'rate 5)
(vlax-invoke sapi "Speak" "Do you want autocad to speak with a fast rate?" 0)
(vlax-put-property sapi 'rate 0)
(vlax-invoke sapi "Speak" "Do you want autocad to speak with a normal rate?" 0)
(vlax-put-property sapi 'rate @rate)
(vlax-invoke sapi "Speak" "Question,         can I also change the voice?" 0)
(print (vlax-get-property (vlax-get-property Sapi 'Voice) 'Id))
(vlax-release-object sapi)
(princ)
)


http://www.microsoft.com/technet/scriptcenter/funzone/games/sapi.mspx
Title: Re: Do you want autocad speak ?
Post by: Patrick_35 on January 22, 2007, 05:40:49 AM
Yes, it's possible
An example to change the voice into French and on a female tone.
Sorry but it's in french   ^-^
http://www.zebulon.fr/astuces/tip200/Synthese-vocale-Windows-en-francais.html
And this
http://www.developpez.net/forums/archive/index.php/t-62567.html

But you can go to http://www.microsoft.com/reader/downloads/pc.asp

@+
Title: Re: Do you want autocad speak ?
Post by: KewlToyZ on January 30, 2007, 06:59:10 PM
oh man I am having fun with this, thanks for the toys!
Title: Re: Do you want autocad speak ?
Post by: HofCAD on January 31, 2007, 03:48:01 AM
Yes, it's possible
An example to change the voice into French and on a female tone.

Dear Patrick_35 and Readers,

I can change the voice, but is this the right way.
Another question  (vlax-invoke sapi "Speak" "Do you want autocad speak with a soft volume" 0)
ends with a zero.
I hear no change when I change it.

Regards,
HofCAD CSI.


Code: [Select]
(defun C:SpeakCfg(/ Sapi ~voice ~volume ~rate Voice VoiceMary VoiceMike
                    VoiceSam VoiceLst NumVoices @PlayWav @NoPath
                    @VoiceList @member+ @Voice&TextInput)

;**********************SubPrograms************************************************
(defun @PlayWav (Sapi WavFile / WavPath @@FindFile ObjFile)
(defun @@FindFile(WavFile / WinDir Path i DirLst)
(setq WinDir (getenv "Windir"))
(setq Path nil i 0 DirLst
(list "" "c:\\" (strcat WinDir "\\")
(strcat WinDir "\\media\\")
(strcat WinDir "\\System\\")
(strcat WinDir "\\System32\\")
(strcat WinDir "\\System64\\")
(strcat WinDir "\\System32\\drivers\\")))
(while (and (< i (length DirLst))
(= (setq Path (findfile (strcat (nth i DirLst) WavFile))) nil))
(setq i (1+ i)))
Path
)
(setq WavPath (@@FindFile WavFile))
(if (and WavPath Sapi)
(progn
(setq ObjFile (vlax-create-object "SAPI.SpFileStream.1"))
(vlax-invoke ObjFile "Open" WavPath)
(vlax-invoke Sapi "Speakstream" ObjFile 0)
(vlax-release-object ObjFile)
))
)
(defun @NoPath(s / cnt ct name)
(setq name (strcase s T))
(if (= (substr name 2 1) ":")
(setq name (substr name 3)))
(setq cnt 1 ct 0)
(repeat (strlen name)
(if (= (substr name cnt 1) "\\")
(setq ct cnt)
)
(setq cnt (1+ cnt))
)
(setq name (substr name (+ 1 ct) cnt))
)
(defun @VoiceList(Sapi / i VoiceLst Voices)
(setq Voices (vlax-invoke Sapi 'GetVoices))
(setq i 0 VoiceLst '())
(repeat (vla-get-count Voices)
(setq VoiceLst (append VoiceLst
(list (vlax-invoke (vla-item Voices i) 'GetDescription))))
(setq i (1+ i))
)
VoiceLst
)
(defun @member+ (x lst /)
(if (vl-member-if '(lambda (y) (wcmatch x y)) lst) x)
)
(defun @Voice&TextInput(voice text / SpeekContent)
(setq SpeekContent (strcat "<VOICE REQUIRED='NAME=" voice "'>" text "</VOICE>"))
)

;**********************Main Program***********************************************
(vl-load-com)
(setq Sapi (vlax-create-object "Sapi.SpVoice"))
(if (not Sapi)(progn
(load "AI_UTILS")(princ "\nWarning: For sound, first install Microsoft Speech SDK 5.1")
(ai_abort "Sapi.SpVoice" (strcat "Warning: No Speech Application Programming Interface"
" with Microsoft Speech" "\n or with the speech module in MS Office."
"\n Suggestion: Install Microsoft Speech SDK 5.1 from http://www.microsoft.com/downloads/"))
))
(setq ~voice (@NoPath (vlax-get-property (vlax-get-property Sapi 'voice) 'Id)))
(cond
((= ~voice "msmary") (setq Voice "Microsoft Mary"))
((= ~voice "msmike") (setq Voice "Microsoft Mike"))
((= ~voice "mssam") (setq Voice "Microsoft Sam"))
(t (setq Voice ~voice))
)
;The voice is normally in Microsoft Speech "Microsoft Mary",
;but in the speech module in MS Office it is "Microsoft Sam".
(setq ~volume (vlax-get-property Sapi 'Volume))
(vlax-put-property Sapi 'Volume 100)
(@playwav Sapi "notify.wav")
(vlax-invoke Sapi "Speak" (strcat "This is " Voice " speaking in AutoCAD with Sapi.     "
"Sapi is short for Speech Application Programming Interface.     "
"You can also use Sapi for playing Wave soundfiles in AutoCAD.") 0)
(@playwav Sapi "Ringin.wav")
(vlax-put-property Sapi 'Volume 10)
(vlax-invoke Sapi "Speak" "Do you want AutoCAD to speak with a soft volume?" 0)
(vlax-put-property Sapi 'Volume 50)
(vlax-invoke Sapi "Speak" "Do you want AutoCAD to speak with a medium volume?" 0)
(vlax-put-property Sapi 'Volume 100)
(vlax-invoke Sapi "Speak" "Do you want AutoCAD to speak with a loud volume?" 0)
;(vlax-put-property Sapi 'Volume ~volume)
(setq ~rate (vlax-get-property Sapi 'Rate))
(vlax-put-property Sapi 'Rate -8)
(vlax-invoke Sapi "Speak" "Do you want AutoCAD to speak with a slow rate?" 0)
(vlax-put-property Sapi 'Rate 5)
(vlax-invoke Sapi "Speak" "Do you want AutoCAD to speak with a fast rate?" 0)
(vlax-put-property Sapi 'Rate 0)
(vlax-invoke Sapi "Speak" "Do you want AutoCAD to speak with a normal rate?" 0)
;(vlax-put-property Sapi 'Rate ~rate)
(vlax-invoke Sapi "Speak" "Question,         Can I also change the voice?" 0)
(setq VoiceLst (@VoiceList Sapi))
;Gives normally with Microsoft Speech:("Microsoft Mary" "Microsoft Mike" "Microsoft Sam" "Sample TTS Voice")
;The voice "Sample TTS Voice" is not usable in a Sapi object, it is for use in TTSapp.exe and TTSappVB.exe
;Gives normally with Microsoft Office speech module:("Microsoft Sam")
(setq NumVoices(length VoiceLst))
(if (@member+ "Sample TTS Voice" VoiceLst) (setq NumVoices (1- NumVoices)))
(if (> NumVoices 1)
(vlax-invoke Sapi "Speak" (strcat "Yes. We can do this, because there are "
(itoa NumVoices) " usable voices on this system.") 0)
(progn
(vlax-invoke Sapi "Speak" (strcat "No. We can't do this, because there is only one voice on this system.  "
"  Probably, only the speech module of Microsoft Office is installed.") 0)
(princ (strcat "\nWarning: For more voices, first install Microsoft Speech SDK 5.1"
"\nfrom http://www.microsoft.com/downloads/"))))
(if (@member+ "Microsoft Mary" VoiceLst) (setq VoiceMary "Microsoft Mary"))
(if (@member+ "Microsoft Mike" VoiceLst) (setq VoiceMike "Microsoft Mike"))
(if (@member+ "Microsoft Sam" VoiceLst) (setq VoiceSam "Microsoft Sam"))
(if (and VoiceMary VoiceMike VoiceSam)
(progn
(vlax-invoke Sapi "Speak" (@Voice&TextInput VoiceMike
"My name is Microsoft Mike, and I have a question for Sam.") 0)
(vlax-invoke Sapi "Speak" (@Voice&TextInput VoiceMike
"Sam, could you say something about Mary?") 0)
(vlax-invoke Sapi "Speak" (@Voice&TextInput VoiceSam
"My name is Microsoft Sam, and I can say that Mary has a little lamb.") 0)
(vlax-invoke Sapi "Speak" (@Voice&TextInput VoiceMary
"Hi, this is Microsoft Mary and I think that Sam is joking like Mister Thomas Edison.") 0)
(vlax-invoke Sapi "Speak" (@Voice&TextInput VoiceMike
"This information is very interesting, and I would like to thank you all.") 0)
)
(progn
(vlax-invoke Sapi "Speak" "Warning      " 0)
(if (not VoiceMary) (vlax-invoke Sapi "Speak" "There is no Microsoft Mary." 0))
(if (not VoiceMike) (vlax-invoke Sapi "Speak" "There is no Microsoft Mike." 0))
(if (not VoiceSam) (vlax-invoke Sapi "Speak" "There is no Microsoft Sam." 0))
))
(@playwav Sapi "tada.wav")
(vlax-release-object sapi)
(princ)
)
Title: Re: Do you want autocad speak ?
Post by: M-dub on January 31, 2007, 02:03:09 PM
Haha... I just freaked my co-worker out by making it say "I am a computer.  I want to be a real boy.  Can't you please help me?"

She honestly thought it was scary.  :)
Title: Re: Do you want autocad speak ?
Post by: Maverick® on January 31, 2007, 02:24:41 PM
Does your cd tray slide out when you tell a lie?  :?
Title: Re: Do you want autocad speak ?
Post by: M-dub on January 31, 2007, 03:27:44 PM
Does your cd tray slide out when you tell a lie?  :?

No, but what an addition to this little routine THAT would be!

"Please Help me!  PLEASE..."   *Out pops the CD Tray, reaching for assistance.*  :lmao:
Title: Re: Do you want autocad speak ?
Post by: Krushert on January 31, 2007, 03:42:22 PM
Does your cd tray slide out when you tell a lie?  :?

No, but what an addition to this little routine THAT would be!

"Please Help me!  PLEASE..."   *Out pops the CD Tray, reaching for assistance.*  :lmao:

I did something similar to that to a girl (with a nickname of Smurffett)  in the office using the office stereo it's remote.  I had her going for 10 minutes soild. She thought the thing was possessed.    :ugly: :-D
 
Title: Re: Do you want autocad speak ?
Post by: M-dub on January 31, 2007, 03:50:49 PM
I did something similar to that to a girl (with a nickname of Smurffett)  in the office using the office stereo it's remote.  I had her going for 10 minutes soild. She thought the thing was possessed.    :ugly: :-D
 

"What the Smurf!?!  This smurfing thing is smurfed!"   :lmao:
Title: Re: Do you want autocad speak ?
Post by: Fuccaro on January 31, 2007, 07:13:22 PM
AutoCAD will speak only if the OS is Windows XP, right?
Is it possible to detect the OS and call the "talking routine" only if it can talk?
Title: Re: Do you want autocad speak ?
Post by: ronjonp on January 31, 2007, 07:36:20 PM
AutoCAD will speak only if the OS is Windows XP, right?
Is it possible to detect the OS and call the "talking routine" only if it can talk?

(getenv "OS")

Did anyone figure out how to detect if sound is muted on the computer and set it to high?

Ron
Title: Re: Do you want autocad speak ?
Post by: Keith™ on January 31, 2007, 08:56:49 PM
You can make Win2000 speak also, but only if the proper updates have been installed. The first development of a speaking system I developed for AutoCAD was done on Win2000 and A2k.

The CD tray thingy can be done in VBA .. and you can call it in lisp ...

VBA Part (put in ThisDrawing window)
Code: [Select]
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Sub OpenCD()
 mciSendString "open CDAudio", vbNull, 0&, vbNull
 mciSendString "set CDAudio door open", vbNull, 0&, vbNull
End Sub

Lisp Part
Code: [Select]
(vl-vbarun "ThisDrawing.OpenCD")

Have fun
Title: Re: Do you want autocad speak ?
Post by: Krushert on January 31, 2007, 09:05:27 PM
Ohh  I can see this now.

code a reactor  to some Autocad command to invoke the speaking part

With Something like

"Please don't do that, I don't like that. Your hurt me! So there fore I am going to open the CD tray."

Then open the CD tray.

Then load onto a persons computer
Title: Re: Do you want autocad speak ?
Post by: StykFacE on February 08, 2007, 08:04:59 AM
lol, this is hilarious. acaddoc.lsp here i come... haha
Title: Re: Do you want autocad speak ?
Post by: GDF on February 08, 2007, 10:30:49 AM
I have been following this thread, and have amazed my coworkers with  my talking computer.
Here is another way to really amaze those around you...

http://www.oddcast.com/home/demos/tts/frameset.php?frame1=talk

Gary
Title: Re: Do you want autocad speak ?
Post by: CAB on February 09, 2007, 07:50:21 AM
You can make Win2000 speak also, but only if the proper updates have been installed. The first development of a speaking system I developed for AutoCAD was done on Win2000 and A2k.

Keith back in 2002 this update failed Internet Explorer Navigation Sound Update on my Windows 2000 system
I can not get the speech to work, is there any hope or would I have to reinstall Microsoft Internet Explorer?
 
My sound does work & i can play movies with sound. Although I have had problems from time to time with some movies.

PS when I use the link Gary supplied, she just looks at me, not even trying to speak.  :-(

Title: Re: Do you want autocad speak ?
Post by: T.Willey on February 09, 2007, 11:07:17 AM
PS when I use the link Gary supplied, she just looks at me, not even trying to speak.  :-(
x2
Title: Re: Do you want autocad speak ?
Post by: terrycadd on February 09, 2007, 11:22:25 AM
I found this info from others trying to get it to work on Windows 2000.
Code: [Select]
No one has gotten this to work in Windows 2000.
No amount of debuging, kicking or droping the computer on the floor will help.
Here is a section of code that I've included in our AcadDoc.lsp file that we're having fun with here at work.
Code: [Select]
(if (= (getvar "dwgname") "Drawing1.dwg");Run one time per new AutoCAD session
  (progn
    ;Create an association list of Login names and Called names
    (setq LoginNames@ (list ;Type Login names in all capitals
      (cons "JDOE" "John")
      (cons "RCAMPOS" "Ricky");Add names per your AutoCAD department
    ));setq
    (if (not (setq Name$ (cdr (assoc (strcase (getvar "LOGINNAME")) LoginNames@))))
      (setq Name$ "")
    );if
    (setq Hour# (atoi (substr (rtos (getvar "cdate") 2 2) 10)))
    (cond
      ((> Hour# 18) (SayIt (strcat "Good evening " Name$)))
      ((> Hour# 12) (SayIt (strcat "Good afternoon " Name$)))
      (t (SayIt (strcat "Good morning " Name$)))
    );cond
  );progn
);if
Here's the SayIt function
Code: [Select]
(defun SayIt (Phrase$ / Sapi)
  (setq Sapi (vlax-create-object "Sapi.SpVoice"))
  (vlax-invoke Sapi "Speak" Phrase$ 0)
  (vlax-release-object Sapi)
  (princ)
);defun SayIt
Title: Re: Do you want autocad speak ?
Post by: CAB on February 09, 2007, 12:47:29 PM
Thanks Terry for the 2K info.
Title: Re: Do you want autocad speak ?
Post by: terrycadd on February 09, 2007, 12:59:54 PM
Here's a link that you might try to test for other free voices, to see if they will run on your system.
http://www.bytecool.com/voices.htm
Title: Re: Do you want autocad speak ?
Post by: M-dub on April 01, 2008, 03:22:36 PM
*bump*

:)

Should have bumped it a few days ago, in preparation for April Fool's.
Title: Re: Do you want autocad speak ?
Post by: Bob Wahr on April 01, 2008, 03:28:19 PM
This takes me back.  I was doing some HD cleanup the outh day and deleted a bunch of the CV agent chat stuff.
Title: Re: Do you want autocad speak ?
Post by: David Hall on April 01, 2008, 04:25:38 PM
Mine wont work,
; error: no function definition: VLAX-CREATE-OBJECT
Title: Re: Do you want autocad speak ?
Post by: T.Willey on April 01, 2008, 05:13:06 PM
Mine wont work,
; error: no function definition: VLAX-CREATE-OBJECT
Do you have (vl-load-com) issued from anywhere?  You have to have this loaded once per session to use the ActiveX calls within lisp.
Title: Re: Do you want autocad speak ?
Post by: David Hall on April 01, 2008, 05:17:47 PM
I knew it was something simple
Title: Re: Do you want autocad speak ?
Post by: T.Willey on April 01, 2008, 05:21:55 PM
I knew it was something simple
Glad it was simple.  By the way, you can call (vl-load-com) as many times as you want with no performance loss, but it only needs to be called once.
Title: Re: Do you want autocad speak ?
Post by: daron on April 02, 2008, 10:23:58 AM
I knew it was something simple
Glad it was simple.  By the way, you can call (vl-load-com) as many times as you want with no performance loss, but it only needs to be called once.
Are you sure?
(while t (vl-load-com)) :lmao: :lmao:
Title: Re: Do you want autocad speak ?
Post by: T.Willey on April 02, 2008, 11:11:51 AM
I knew it was something simple
Glad it was simple.  By the way, you can call (vl-load-com) as many times as you want with no performance loss, but it only needs to be called once.
Are you sure?
(while t (vl-load-com)) :lmao: :lmao:
I stand corrected.  Good one Daron.
Title: Re: Do you want autocad speak ?
Post by: TimSpangler on April 02, 2008, 12:43:06 PM
How in the heck did I miss this thread???

Great one!
Title: Re: Do you want autocad speak ?
Post by: David Hall on April 02, 2008, 12:55:48 PM
(while t (vl-load-com))

seems to lock up my computer, ideas?
Title: Re: Do you want autocad speak ?
Post by: T.Willey on April 02, 2008, 12:59:29 PM
(while t (vl-load-com))

seems to lock up my computer, ideas?
Because it is always true, so it will keep issuing (vl-load-com).  Just do it once, no while loop, at the beginning of the code.
Title: Re: Do you want autocad speak ?
Post by: daron on April 02, 2008, 01:38:36 PM
It was a joke David. I was just toying with Tim's comment about being able to use (vl-load-com) as much as you want without performance loss. With that while loop, it will never finish executing the vl-load-com. You have performance loss from the get go, because it will eternally load or lock up as you experienced, never getting to the rest of the procedures.
Title: Re: Do you want autocad speak ?
Post by: TimSpangler on April 02, 2008, 01:47:08 PM
OK we can get autocad to speak but what about play tones.  I read in the a lisp programming book (not sure which one) that you can get autocad to beep. (or play sounds).

Anyone here know how this is possible.  (I cold get the example to work if I remember)  I also have beep on error turned off maybe that has something to do with it.
Title: Re: Do you want autocad speak ?
Post by: David Hall on April 02, 2008, 01:50:31 PM
It was a joke David. I was just toying with Tim's comment about being able to use (vl-load-com) as much as you want without performance loss. With that while loop, it will never finish executing the vl-load-com. You have performance loss from the get go, because it will eternally load or lock up as you experienced, never getting to the rest of the procedures.
I guess I should have read it a little closer.  For that matter, I should use LISP more
Title: Re: Do you want autocad speak ?
Post by: Keith™ on April 02, 2008, 01:51:10 PM
OK we can get autocad to speak but what about play tones.  I read in the a lisp programming book (not sure which one) that you can get autocad to beep. (or play sounds).

Anyone here know how this is possible.  (I cold get the example to work if I remember)  I also have beep on error turned off maybe that has something to do with it.
you can get it to play any sound file located on your computer.
Title: Re: Do you want autocad speak ?
Post by: KewlToyZ on April 03, 2008, 11:14:53 AM
LOL I could just hear it now....
User Clicks on Close....
song starts "I hate everything about you....." :lmao:
error while in CAD, a Jim Carey sound byte "Yes! Yes! Can ya feel that buddy? Huh? Huh?"
Title: Re: Do you want autocad speak ?
Post by: TimSpangler on April 03, 2008, 11:23:00 AM
I have a question about the MSAgents  Can the be accessed through lisp?  Can I show the characters with lisp?
Title: Re: Do you want autocad speak ?
Post by: Keith™ on April 03, 2008, 08:29:12 PM
I havn't looked at MsAgents
Title: Re: Do you want autocad speak ?
Post by: TimSpangler on April 03, 2008, 08:38:57 PM
I have been playing around with a couple of things from this thread.  I can't seem to get the voice to change.  Is it possible?.  I also played with the MSagents to no avail. (I don't know enough about accessing dll to get anything to work).  Maybe some one can shed some light on this subject, or start a new thread with a little tut. to get me going.
Title: Re: Do you want autocad speak ?
Post by: CAB on April 03, 2008, 09:53:26 PM
You can try this tim, but it never worked for me.
(write-char 7)
Title: Re: Do you want autocad speak ?
Post by: DEVITG on May 11, 2008, 11:36:29 AM
Well this thread certainly got the creative juices flowing...

Let's have some fun with the MS Agent as well!


Hi How I can runt the MS agent.
I appload it , but I have no way to call or use it.
Thanks in advance
Title: Re: Do you want autocad speak ?
Post by: CECE_CAD on May 15, 2008, 05:06:17 PM
Ok, so Just wondering... How do you call a command (still having the command work) and have this be called at the same time or after, even before if possible.. Would you use an IF statement? 

I was using the copy command.. but its to obvious because it stops the copy command. 

Code: [Select]
(DEFUN c:C ()
  (setq sapi (vlax-create-object "Sapi.SpVoice"))
  (vlax-invoke sapi "Speak" "Johnny!." 0)
  (vlax-invoke sapi "Speak" "What are you doing?." 0)
  (vlax-release-object sapi)
  )
Title: Re: Do you want autocad speak ?
Post by: CAB on May 15, 2008, 05:54:25 PM
Create a reactor and have it look for the start of a command.
You could modify this one.
http://www.theswamp.org/index.php?topic=22733.msg273953#msg273953
Title: Re: Do you want autocad speak ?
Post by: CECE_CAD on May 15, 2008, 06:01:01 PM
 :-o Woo!! I will try to modify.. :laugh: Thanks...
Title: Re: Do you want autocad speak ?
Post by: TimSpangler on August 28, 2008, 12:41:13 PM
*BUMP*

 :-P
Title: Re: Do you want autocad speak ?
Post by: jnieman on August 28, 2008, 03:24:33 PM
haha good timing.
Title: Re: Do you want autocad speak ?
Post by: HofCAD on September 04, 2008, 07:06:46 AM
For Five Sound Animations or Simulations of the Maltese cross or Geneva mechanism(HofMalt.zip),
and three Parallel mechanism(HofPar.zip) see:
http://forums.augi.com/showthread.php?t=55713&page=4

Regards,
HofCAD CSI
Title: Re: Do you want autocad speak ?
Post by: BrunoToniutti on October 02, 2008, 05:29:32 AM
 :-D funny !
thx Patrick and other people,

I changed the voice with "LH Veronique", it's fine

Code: [Select]
(vlax-create-object "Sapi.SpVoice")
(vlax-invoke sapi "Speak" "<VOICE REQUIRED=\"NAME=LH Veronique\">Patrick, merci et bonne journée" 0)

 :-) Bruno
Title: Re: Do you want autocad speak ?
Post by: Andrea on October 02, 2008, 10:18:08 AM
Want to Use SAPI to play wav file ?

Code: [Select]
(setq objVoice (vlax-create-object "Sapi.SpVoice")
      objFile  (vlax-create-object "SAPI.SpFileStream.1")
)
(vlax-invoke objFile "Open" "c:\\Windows\\Media\\Ding.wav")
(vlax-invoke objVoice "Speakstream" objFile 0)
(vlax-release-object objVoice)
(vlax-release-object objFile)
Title: Re: Do you want autocad speak ?
Post by: TimSpangler on October 02, 2008, 12:08:57 PM
May want to look to see what voices are available first:

;; Check for available voices in registry
(vl-registry-descendents  "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\")

<This is why I couldn't change the voice - I only had one voice installed /slaps forehead)
Title: Re: Do you want autocad speak ?
Post by: Andrea on October 02, 2008, 02:16:09 PM
May want to look to see what voices are available first:

;; Check for available voices in registry
(vl-registry-descendents  "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\")

<This is why I couldn't change the voice - I only had one voice installed /slaps forehead)



or this...

Code: [Select]
(setq objVoice (vlax-create-object "Sapi.SpVoice"))
(setq voice (vlax-get objVoice "Voice"))
(vlax-invoke voice 'GetDescription)
(vlax-release-object objVoice)
(vlax-release-object voice)
Title: Re: Do you want autocad speak ?
Post by: TimSpangler on October 02, 2008, 05:13:15 PM
May want to look to see what voices are available first:

;; Check for available voices in registry
(vl-registry-descendents  "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\")

<This is why I couldn't change the voice - I only had one voice installed /slaps forehead)
That will give the current voice but not the available voices.....


or this...

Code: [Select]
(setq objVoice (vlax-create-object "Sapi.SpVoice"))
(setq voice (vlax-get objVoice "Voice"))
(vlax-invoke voice 'GetDescription)
(vlax-release-object objVoice)
(vlax-release-object voice)
Title: Re: Do you want autocad speak ?
Post by: Andrea on October 02, 2008, 06:58:48 PM
May want to look to see what voices are available first:

;; Check for available voices in registry
(vl-registry-descendents  "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\")

<This is why I couldn't change the voice - I only had one voice installed /slaps forehead)
That will give the current voice but not the available voices.....


or this...

Code: [Select]
(setq objVoice (vlax-create-object "Sapi.SpVoice"))
(setq voice (vlax-get objVoice "Voice"))
(vlax-invoke voice 'GetDescription)
(vlax-release-object objVoice)
(vlax-release-object voice)

Yes you'r right.....it was only an example..
we need to use
Code: [Select]
(vlax-for ... maybe ?
Title: Re: Do you want autocad speak ?
Post by: Notsober on October 17, 2008, 10:15:42 AM
wow. I so want to try this... but have NO IDEA where to start.

could someone please point me in the right direction?
Title: Re: Do you want autocad speak ?
Post by: KewlToyZ on October 17, 2008, 01:15:36 PM
Download this lsp file.
Place a copy of it in your AutoCAD support folder.
(example for AutoCAD MEP 2008)
C:\Documents and Settings\YourUserName\Application Data\Autodesk\ACD-MEP 2008\enu\Support

Open Your AutoCAD, type appload into the command line.
In the dialog box, browse to the folder you copied it to and select sayit.lsp
Click the load button, close the dialog box.
type:
sayit
into the command line.
type what you want AutoCAD to say.
This is an example of AutoCAD using text to speech.
If you wanted to load it with each session of AutoCAD you start you would likely want to either place this code into your acad.mnl file or your acad.lsp, or your acaddoc.lsp file.

(autoload "sayit" '("sayit"))
Title: Re: Do you want autocad speak ?
Post by: Notsober on October 17, 2008, 03:11:11 PM
Download this lsp file.
Place a copy of it in your AutoCAD support folder.
(example for AutoCAD MEP 2008)
C:\Documents and Settings\YourUserName\Application Data\Autodesk\ACD-MEP 2008\enu\Support

Open Your AutoCAD, type appload into the command line.
In the dialog box, browse to the folder you copied it to and select sayit.lsp
Click the load button, close the dialog box.
type:
sayit
into the command line.
type what you want AutoCAD to say.
This is an example of AutoCAD using text to speech.
If you wanted to load it with each session of AutoCAD you start you would likely want to either place this code into your acad.mnl file or your acad.lsp, or your acaddoc.lsp file.

(autoload "sayit" '("sayit"))

cool cool. well see, I didn't know it was a lisp routine. I thought it was some sort of VBA code (which is where my weakness is - I guess I still can't recognize the difference between lisp routines and other code languages).

YAY I know what to do with lisps... lol. And why would I have to add the code into my acad.mnl or acad.lsp or acaddoc.lsp? isn't it easier to just add the sayit.lsp to the StartUp Suite?
Title: Re: Do you want autocad speak ?
Post by: KewlToyZ on October 20, 2008, 09:21:22 AM
Depends on what sort of deployment you have in place.
I have a bunch of customizations on a network drive and a profile loading it up afor all of my users.
For the most part using start up suite is not good practice in an enterprise environment.  :kewl:
Title: Re: Do you want autocad speak ?
Post by: HofCAD on October 21, 2008, 01:07:36 PM
May want to look to see what voices are available first:

;; Check for available voices in registry
(vl-registry-descendents  "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\")

<This is why I couldn't change the voice - I only had one voice installed /slaps forehead)

Code: [Select]
(defun C:VoiceList(/ i VoiceLst)
(setq  Sapi (vlax-create-object "Sapi.SpVoice"))
(setq Voices (vlax-invoke Sapi 'GetVoices))
(setq i 0 VoiceLst '())
(repeat (vla-get-count Voices)
(setq VoiceLst (append VoiceLst
(list (vlax-invoke (vla-item Voices i) 'GetDescription))))
(setq i (1+ i))
)
;(vlax-release-object Sapi)
VoiceLst
)
VoiceList or (C:VoiceList) gives to me:
("Microsoft Mary" "Microsoft Mike" "Microsoft Sam" "Sample TTS Voice")


For sound Animations or Simulations of
five Maltese cross or Geneva mechanism (HofMalt.zip),
three Parallel mechanism(HofPar.zip),
Pulley, Valve, Bench Vice and a Hammer(HofAni1.zip) and for
exploded views of an U-bolt pipe strap and Shaft clamp(HofAni2.zip)
see:
http://forums.augi.com/showthread.php?t=55713&page=4&highlight=animation (http://forums.augi.com/showthread.php?t=55713&page=4&highlight=animation)

Regards,
HofCAD CSI

PS I made some modifications and additions in SpeakCfg.lsp.
For example, adding Wav sound, voice identification and warnings.

The program SpeakCfg is Using the Speech Application Programming Interface
from Microsoft Speech SDK 5.1 (http://www.microsoft.com/downloads/") or the
speech module from Microsoft Office (Microsoft Word 2002, or Microsoft Excel 2002).
Title: Re: Do you want autocad speak ?
Post by: deegeecees on March 24, 2011, 10:44:38 AM
*bump*

April Fools Day is right around the corner.
Title: Re: Do you want autocad speak ?
Post by: Matt__W on March 24, 2011, 01:15:46 PM
*bump*

April Fools Day is right around the corner.
That's my birthday!  :)
Title: Re: Do you want autocad speak ?
Post by: Nibster on March 24, 2011, 02:14:24 PM
*bump*

April Fools Day is right around the corner.
That's my birthday!  :)
your mom failed to keep legs crossed till after midnight, huh?

 :lmao:

mine succeeded.  8-)
Title: Re: Do you want autocad speak ?
Post by: Matt__W on March 24, 2011, 02:18:20 PM
*bump*

April Fools Day is right around the corner.
That's my birthday!  :)
your mom failed to keep legs crossed till after midnight, huh?

 :lmao:

mine succeeded.  8-)
That's the ONLY time your mom kept her legs crossed.  *ZING!!*
Title: Re: Do you want autocad speak ?
Post by: alanjt on March 24, 2011, 04:34:39 PM
Totally off topic, but are those your feet/shoes, Matt? I've seen those shoes but don't know anyone with them. Do you like them?
Title: Re: Do you want autocad speak ?
Post by: Matt__W on March 25, 2011, 08:09:20 AM
Totally off topic, but are those your feet/shoes, Matt? I've seen those shoes but don't know anyone with them. Do you like them?
Yes, those are my feet/shoes.  I have two pairs and I love 'em.  Those are the Vibram KSOs (http://www.vibramfivefingers.com/products/Five-Fingers-KSO-Mens.htm).  I do about 25% of my running in them - roads, dreadmill, or in this case muddy trails.  :love:

I'm easing back into them after this past winter when I didn't use them at all - I've got start building up the calluses on my feet again.
Title: Re: Do you want autocad speak ?
Post by: Harrie on March 26, 2011, 08:49:49 PM
Nice Jokes,

But is it possible to change the voice of Mary in something different,
without using  Microsoft Speech SDK 5.1.
Code: [Select]
(vl-load-com)
(setq Sapi (vlax-create-object "Sapi.SpVoice"))
(setq Voice (vlax-get-property Sapi 'voice))
(vlax-dump-object Voice T)
With Microsoft Speech I only hear the voices of Mary, Mike and Sam.

Regards.
Title: Re: Do you want autocad speak ?
Post by: alanjt on March 28, 2011, 09:51:27 AM
Totally off topic, but are those your feet/shoes, Matt? I've seen those shoes but don't know anyone with them. Do you like them?
Yes, those are my feet/shoes.  I have two pairs and I love 'em.  Those are the Vibram KSOs (http://www.vibramfivefingers.com/products/Five-Fingers-KSO-Mens.htm).  I do about 25% of my running in them - roads, dreadmill, or in this case muddy trails.  :love:

I'm easing back into them after this past winter when I didn't use them at all - I've got start building up the calluses on my feet again.
Very cool. Is there a difference in those and what they call Camp Shoes?
I've been wanting to get a pair, but the price is a hard pill to swallow. I been working for years at hardening my feet (don't wear shoes unless I have to), but I'm still not brave enough to cruise deep in the woods barefoot.
It'd be a site seeing me come out of the woods during hunting season wearing those.  :lol:

I'll eventually get a pair...
Title: Re: Do you want autocad speak ?
Post by: Matt__W on March 28, 2011, 09:54:53 AM
Totally off topic, but are those your feet/shoes, Matt? I've seen those shoes but don't know anyone with them. Do you like them?
Yes, those are my feet/shoes.  I have two pairs and I love 'em.  Those are the Vibram KSOs (http://www.vibramfivefingers.com/products/Five-Fingers-KSO-Mens.htm).  I do about 25% of my running in them - roads, dreadmill, or in this case muddy trails.  :love:

I'm easing back into them after this past winter when I didn't use them at all - I've got start building up the calluses on my feet again.
Very cool. Is there a difference in those and what they call Camp Shoes?
I've been wanting to get a pair, but the price is a hard pill to swallow. I been working for years at hardening my feet (don't wear shoes unless I have to), but I'm still not brave enough to cruise deep in the woods barefoot.
It'd be a site seeing me come out of the woods during hunting season wearing those.  :lol:

I'll eventually get a pair...
What are "camp shoes"?
Title: Re: Do you want autocad speak ?
Post by: alanjt on March 28, 2011, 09:56:07 AM
Totally off topic, but are those your feet/shoes, Matt? I've seen those shoes but don't know anyone with them. Do you like them?
Yes, those are my feet/shoes.  I have two pairs and I love 'em.  Those are the Vibram KSOs (http://www.vibramfivefingers.com/products/Five-Fingers-KSO-Mens.htm).  I do about 25% of my running in them - roads, dreadmill, or in this case muddy trails.  :love:

I'm easing back into them after this past winter when I didn't use them at all - I've got start building up the calluses on my feet again.
Very cool. Is there a difference in those and what they call Camp Shoes?
I've been wanting to get a pair, but the price is a hard pill to swallow. I been working for years at hardening my feet (don't wear shoes unless I have to), but I'm still not brave enough to cruise deep in the woods barefoot.
It'd be a site seeing me come out of the woods during hunting season wearing those.  :lol:

I'll eventually get a pair...
What are "camp shoes"?
http://www.amazon.com/Original-MuckBoots-Unisex-Edgewater-Womens/dp/B000WG7NV6/ref=sr_1_1?ie=UTF8&qid=1301320551&sr=8-1
Title: Re: Do you want autocad speak ?
Post by: Matt__W on March 28, 2011, 10:04:01 AM
Yeah... Vibrams are a LOT different from camp shoes.   :-D
Title: Re: Do you want autocad speak ?
Post by: alanjt on March 28, 2011, 10:05:25 AM
Yeah... Vibrams are a LOT different from camp shoes.   :-D
Minus the toes? I've never seen either in person, so I really was curious.
Title: Re: Do you want autocad speak ?
Post by: jah011 on March 18, 2015, 10:41:17 AM
Hi guys... I like this thread so much.

I am trying to make it work but my skills are still quite poor.

I would like to make acad say Kaboom when I explode ...

i did this simple code but it is not really synchronized :)

Code: [Select]
(defun  C:exx () (command "explode")
(setq sapi (vlax-create-object "Sapi.SpVoice"))
(vlax-invoke sapi "Speak" "Kaboom" 0)
(vlax-release-object sapi))

I would like to see principle , to have simple function that after it is done says something or even better play a sound. Also I would need to have volume up.

Thanks
Jan
Title: Re: Do you want autocad speak ?
Post by: Andrea on March 18, 2015, 03:09:47 PM
Hi jah011 and welcome to theswamp.


try this:

Code: [Select]
(defun  C:exx ()
(command "._explode")
(while (/= 0 (getvar 'cmdactive))
  (princ)
  )
(setq sapi (vlax-create-object "Sapi.SpVoice"))
 (vlax-put-property sapi 'volume 2);;;volume
  (vlax-put-property sapi 'rate 2);;;speed
(vlax-invoke sapi "Speak" "Kaboom" 0)
(vlax-release-object sapi)
  )

Title: Re: Do you want autocad speak ?
Post by: jah011 on March 18, 2015, 05:28:21 PM
Hi Andrea!
Thanks for the help!
I changed a routine according to some other comments and it goes like this now

Code: [Select]
(defun  C:kab () (command "explode")
(while (> (getvar 'cmdactive) 0) (command pause))

(setq sapi (vlax-create-object "Sapi.SpVoice"))
 (vlax-put-property sapi 'volume 100);;;volume
  (vlax-put-property sapi 'rate -3);;;speed
(vlax-invoke sapi "Speak" "Kaboom" 0)
(vlax-release-object sapi)
  )

Another thing, maybe i am stretching out too far but i was trying to implement your code for playing wav... but no success

Quote
(setq objVoice (vlax-create-object "Sapi.SpVoice")
      objFile  (vlax-create-object "SAPI.SpFileStream.1")
)
(vlax-invoke objFile "Open" "c:\\Windows\\Media\\Ding.wav")
(vlax-invoke objVoice "Speakstream" objFile 0)
(vlax-release-object objVoice)
(vlax-release-object objFile)
Title: Re: Do you want autocad speak ?
Post by: BlackBox on March 18, 2015, 06:07:39 PM
These (http://forums.augi.com/showthread.php?53823-AutoCAD-Speak&p=1136694&viewfull=1#post1136694) old (http://forums.augi.com/showthread.php?53823-AutoCAD-Speak&p=1136822&viewfull=1#post1136822) posts (http://forums.augi.com/showthread.php?53823-AutoCAD-Speak&p=1154706&viewfull=1#post1154706) may be of use.  :-)

Cheers




Title: Re: Do you want autocad speak ?
Post by: NICK_VNV on March 19, 2015, 08:26:03 AM
Another thing, maybe i am stretching out too far but i was trying to implement your code for playing wav... but no success

Quote
(setq objVoice (vlax-create-object "Sapi.SpVoice")
      objFile  (vlax-create-object "SAPI.SpFileStream.1")
)
(vlax-invoke objFile "Open" "c:\\Windows\\Media\\Ding.wav")
(vlax-invoke objVoice "Speakstream" objFile 0)
(vlax-release-object objVoice)
(vlax-release-object objFile)
Try this method for wav, mp3, etc...
Code: [Select]
(Setq wmp (vlax-get-or-Create-Object "MediaPlayer.MediaPlayer.1"))
(vlax-invoke-method wmp 'Open "c:\\Windows\\Media\\Ding.wav")
...
(vlax-invoke-method wmp 'Stop)
(vlax-release-object wmp)
Title: Re: Do you want autocad speak ?
Post by: NOT SURE on March 19, 2015, 09:55:37 AM
How would this be done in a SCR type file outside of AutoCad?
Title: Re: Do you want autocad speak ?
Post by: ronjonp on March 19, 2015, 10:58:12 AM
How would this be done in a SCR type file outside of AutoCad?


Maybe THIS (http://www.visualbasicscript.com/Making-PC39s-Speak-with-SAPISpVoice-m63061.aspx) ?
Title: Re: Do you want autocad speak ?
Post by: NOT SURE on March 19, 2015, 12:55:12 PM
How would this be done in a SCR type file outside of AutoCad?


Maybe THIS (http://www.visualbasicscript.com/Making-PC39s-Speak-with-SAPISpVoice-m63061.aspx) ?

Couldn't the SAPISpVoice be called through a SCR or a BAT file? I've tried the VBS route but I can't run it since I don't have Visual Studio.
Title: Re: Do you want autocad speak ?
Post by: ronjonp on March 19, 2015, 01:03:38 PM
You should be able to copy the code into notepad and save the file with a VBS extension. Then just double click on it.
Title: Re: Do you want autocad speak ?
Post by: NOT SURE on March 19, 2015, 01:37:24 PM
You should be able to copy the code into notepad and save the file with a VBS extension. Then just double click on it.

I've tried that, and I don't have any program that will run it. I get the "Windows cannot open this file" dialog box. What am I missing?
Title: Re: Do you want autocad speak ?
Post by: ronjonp on March 19, 2015, 01:52:06 PM
You probably have to associate the file with MS Windows Script Based Host.
Title: Re: Do you want autocad speak ?
Post by: NOT SURE on March 19, 2015, 01:59:50 PM
You probably have to associate the file with MS Windows Script Based Host.

I just tried associating it with Wscript.exe, and still nothing. It throws an error.
Title: Re: Do you want autocad speak ?
Post by: ronjonp on March 19, 2015, 02:27:12 PM
Not sure .. maybe a security setting ?
Title: Re: Do you want autocad speak ?
Post by: NOT SURE on March 19, 2015, 02:48:20 PM
Not sure .. maybe a security setting ?

Bah, no big deal. I was just curious and wanted to play around. I've got bigger fish to fry right now, but if I get a solution I'll throw it in here. I appreciate the help though, thanks.
Title: Re: Do you want autocad speak ?
Post by: gile on June 25, 2019, 02:37:43 PM
Hi,

Bad news, Patrick_35, the author of this popular thread died this year in March.
He was an active member of the French AutoCAD community, particularly on AutoLISP programming.
He was one of my mentors when I started using AutoLISP and encouraged me to follow Visual LISP (ActiveX).
Bye Patrick...
Title: Re: Do you want autocad speak ?
Post by: MP on June 25, 2019, 02:45:50 PM
I’m very saddened to learn this. Thank you Mr. Chanteau. RIP Patrick.
Title: Re: Do you want autocad speak ?
Post by: Lee Mac on June 25, 2019, 02:47:36 PM
I'm sorry to hear of this sad news, my sincere condolences go out to his family.
Patrick was a valued member of the CAD community and I, too, benefited in my learning from his knowledgeable contributions - he will be sorely missed by all.
Title: Re: Do you want autocad speak ?
Post by: GDF on June 25, 2019, 04:40:00 PM
Sorry to here this.
Title: Re: Do you want autocad speak ?
Post by: ronjonp on June 25, 2019, 09:21:54 PM
I'm sorry to hear this as well. He will be missed. :-\
Title: Re: Do you want autocad speak ?
Post by: Jeff H on June 28, 2019, 01:35:34 AM
Hi,

Bad news, Patrick_35, the author of this popular thread died this year in March.
He was an active member of the French AutoCAD community, particularly on AutoLISP programming.
He was one of my mentors when I started using AutoLISP and encouraged me to follow Visual LISP (ActiveX).
Bye Patrick...
:-(
Is that the same guy who started www.acadnetwork.com fourms?
Title: Re: Do you want autocad speak ?
Post by: Marc'Antonio Alessi on June 28, 2019, 01:42:43 AM
Sincere condoglianze a tutta la famiglia.
Marco
Title: Re: Do you want autocad speak ?
Post by: gile on June 28, 2019, 01:58:02 AM
Hi,

Bad news, Patrick_35, the author of this popular thread died this year in March.
He was an active member of the French AutoCAD community, particularly on AutoLISP programming.
He was one of my mentors when I started using AutoLISP and encouraged me to follow Visual LISP (ActiveX).
Bye Patrick...
:-(
Is that the same guy who started www.acadnetwork.com fourms?

No.
The guy who started acadnetwork is Patrick (Emin) which is now the Autodesk French Community manager (https://forums.autodesk.com/t5/user/viewprofilepage/user-id/528014).
Patrick_35, despite my efforts, never came to .NET programming.