help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

playing sounds from Emacs


From: Emanuel Berg
Subject: playing sounds from Emacs
Date: Mon, 14 Aug 2017 02:16:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

PS. Don't forget to download the sound
    file! DS.

Remember the discussion where I said the computer
should be silent? Only the huge fan of the
nearby industrial plant, or the lazy buzz of
the starship engine, should make for a pleasant
trip to the oldest galaxies of the universe...

Anyway, I think it was I that came up with the
rule, that there isn't a rule without an
exception, so I decided to play a sound from
Emacs whenever I use a function to check the
integrity of the system, if the check turns
out OK!

So far, what happens is, it calls a shell
function. I actually happen to know, that that
is a fine way of doing it. Even so, it would be
interesting to hear of other ways and/or
interfaces that you are familiar with!

Here is the code:

    (shell-command "omx-play-sound ~/bo/up.mp3")

;; Here is the sound file (89K) - bonus points
;; if you can identify the two parts :)
;;
;;     http://user.it.uu.se/~embe8573/sounds/up.mp3

;; Here is the zsh function, in a file that is
;; 'source'd from ~/.zshenv to be visible from
;; Emacs:

;; omx-play-sound () {
;;     local -a files
;;     files=($@)
;;
;;     check-files $files # error checking, never mind it
;;     (( $? == 1 )) && return 1
;;
;;     local vol=200
;;
;;     for f in $files; do
;;         sudo omxplayer    \
;;              --adev local \
;;              --vol $vol   \
;;              $f           \
;;              > /dev/null  # no verbose option in omxplayer(1)
;;     done
;; }

;; Original files:
;;
;;     http://user.it.uu.se/~embe8573/conf/.zshenv
;;
;;     http://user.it.uu.se/~embe8573/conf/.zsh/omx

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]