LISP SOUND

HI,

I am developing a LISP program and I need the program to make a sound (for example, when an error occurs).
Is there any way to do that?

Thanks

Comments

  • This is a stripped down version of the original SayItNow.lsp I found years ago.

    ;-------------------------------------------------------------------------------
    ; Program Name: SayIt.lsp
    ; Created By:   Terry Miller
    ; Date Created: 1-20-07
    ; Function:     Says Phrase$ through computer speakers
    ; Note:         This will only work on systems after Windows 2000.
    ;-------------------------------------------------------------------------------
    (defun SayIt (Phrase$ / Sapi)
      (vl-load-com)
      (setq Sapi (vlax-create-object "Sapi.SpVoice"))
      (vlax-invoke Sapi "Speak" Phrase$ 0)
      (vlax-release-object Sapi))

    (defun c:SayItNow (/ )
      (setq sMsg "Hello World")
      (SayIt sMsg))
  • If a 'nasty' beep is OK you can use:
    (vlr-beep-reaction)

    Or, even worse:
    (acet-sys-beep int)
    Int can be: -1, 0, 16, 32, 48 or 64.

    I personally would never use a 'beep-on-error' feature.
    If you do introduce it, make sure the user can disable it.
  • Thanks Donald.
    And thanks Roy again
This discussion has been closed.