Function: play-sound

play-sound is a byte-compiled function defined in subr.el.gz.

Signature

(play-sound SOUND)

Documentation

SOUND is a list of the form (sound KEYWORD VALUE...).

The following keywords are recognized:

  :file FILE - read sound data from FILE. If FILE isn't an
absolute file name, it is searched in data-directory.

  :data DATA - read sound data from string DATA.

Exactly one of :file or :data must be present.

  :volume VOL - set volume to VOL. VOL must an integer in the
range 0..100 or a float in the range 0..1.0. If not specified, don't change the volume setting of the sound device.

  :device DEVICE - play sound on DEVICE. If not specified,
a system-dependent default device name is used.

Note: :device is currently not supported on Windows.

View in manual

Probably introduced at or before Emacs version 21.1.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun play-sound (sound)
  "SOUND is a list of the form `(sound KEYWORD VALUE...)'.
The following keywords are recognized:

  :file FILE - read sound data from FILE.  If FILE isn't an
absolute file name, it is searched in `data-directory'.

  :data DATA - read sound data from string DATA.

Exactly one of :file or :data must be present.

  :volume VOL - set volume to VOL.  VOL must an integer in the
range 0..100 or a float in the range 0..1.0.  If not specified,
don't change the volume setting of the sound device.

  :device DEVICE - play sound on DEVICE.  If not specified,
a system-dependent default device name is used.

Note: :device is currently not supported on Windows."
  (if (fboundp 'play-sound-internal)
      (play-sound-internal sound)
    (error "This Emacs binary lacks sound support")))