summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorPavel Janík <Pavel@Janik.cz>2002-04-07 10:09:39 +0000
committerPavel Janík <Pavel@Janik.cz>2002-04-07 10:09:39 +0000
commit324cd947a2c603ea380058750961bc24fce9e175 (patch)
tree8e0c0d4c809b42f823526b179806d7cb3de7c48b /lisp/subr.el
parenta155c353314163dc8414b977e510716245e13d2e (diff)
downloademacs-324cd947a2c603ea380058750961bc24fce9e175.tar.gz
(play-sound): Move here from simple.el.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index fb03b7ad1ba..5a80298ca59 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1967,4 +1967,25 @@ clone should be incorporated in the clone."
(overlay-put ol2 'evaporate t)
(overlay-put ol2 'text-clones dups)))
+(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."
+ (unless (fboundp 'play-sound-internal)
+ (error "This Emacs binary lacks sound support"))
+ (play-sound-internal sound))
+
;;; subr.el ends here