FastFiber

Acad praat!

Gestart door EddyBeerke, di 10 02 2009, 08:10:09

Vorige topic - Volgende topic

EddyBeerke

Deze "topic" hoort gewoon in het "autocad babbelhoekje"

Ja, beste mensen AutoCad kan praten:
http://www.theswamp.org/index.php?topic=14549.msg175818#msg175818

(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)


Zie ook onderstaande aanvulling.

Citaat van: HofCAD op ma 22 01 2007, 09:46:53
Beste CAD liefhebbers,

Op http://www.theswamp.org/index.php?topic=14549.0 heeft Patrick_35
een tip gegeven om AutoCAD te laten praten via Microsoft Speech.


(defun C:speak(/ @volume @rate VoiceMary VoiceMike VoiceSam)
(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)
(setq VoiceMary "Microsoft Mary"
      VoiceMike "Microsoft Mike"
      VoiceSam  "Microsoft Sam"
)
(defun Voice&TextInput(voice text)
(setq speekContent
       (strcat "<VOICE REQUIRED='NAME=" voice "'>")
    )
    (setq speekContent
       (strcat speekContent text
           "</VOICE>"
       )
    )
)
(vlax-invoke sapi "Speak" (voice&textInput VoiceMike
"My name is 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 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)
(princ)
(vlax-release-object sapi)
)



Met vriendelijke groet,
Hofcad CSI
Civil3d 2026, Blender 4.x gebruiker
Gebruiker sinds AutoCAD R12

http://eddylucas.c1.biz/
https://www.google.com/maps/contrib/109381066561676463628/photos/

Joop

Gelukkig, nu hoeft lezen ook al niet meer.  :lol:
Een gelovig volger van
"de Sacrale Kunst van Luiheid",
zijn leider "Lisp" en acoliet "Script".

HofCAD

#2
Citaat van: EddyBeerke op di 10 02 2009, 08:10:09
Deze "topic" hoort gewoon in het "autocad babbelhoekje"
Ja, beste mensen AutoCad kan praten:

Beste Eddy,

Heb je hier al na gekeken:
http://forums.augi.com/showthread.php?t=55713&page=4
naar resp. HofMalt, HofPar, HofAni1, HofAni2 en HofAni3,
voor bijv. een 3D hefboomplaatschaar met geluid.

Met vriendelijke groet, HofCAD CSI.

PS Het bovenstaande programma Speak is veranderd in SpeakCfg.
http://www.cadsite.be/smf/index.php?topic=1563.msg8282#msg8282
Het programma SpeakCfg gebruikt de Speech Application Programming Interface
van Microsoft Speech SDK 5.1 (http://www.microsoft.com/downloads/") of de
speech module van Microsoft Office (Microsoft Word 2002, or Microsoft Excel 2002).
ACADcadabra

yoin