From 1a9c52533a7a6a5e9496a7f6838af70253342d59 Mon Sep 17 00:00:00 2001 From: Paul Steckler Date: Thu, 25 Jan 2001 21:19:11 +0000 Subject: [PATCH] Added Linux, Solaris sound original commit: 5f0088d97801430e39b1adf8caedad52009c8907 --- src/mred/wrap/mred.ss | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/mred/wrap/mred.ss b/src/mred/wrap/mred.ss index fc177316..d9e1f167 100644 --- a/src/mred/wrap/mred.ss +++ b/src/mred/wrap/mred.ss @@ -5163,7 +5163,22 @@ (begin (unless (string? f) (raise-type-error 'play-sound "string" f)) - (let ([b (box "cat ~s > /dev/audio")]) + (let* ([subpath (system-directory-subpath)] + [make-pattern (lambda (s) (string-append ".*" s ".*"))] + [b + (box + (cond + [(regexp-match (make-pattern "linux")) + ; use play interface to sox + "play ~s"] + [(regexp-match (make-pattern "solaris")) + "audioplay ~s"] + [else + (raise-mismatch-error + 'play-sound + "Don't know how to play sounds on architecture" + subpath)]))]) + ; see if user has overridden defaults (wx:get-resource "mred" "playcmd" b) ((if async? (lambda (x) (process x) #t) system) (format (unbox b) (expand-path f)))))))