unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* playing sounds from Emacs
@ 2017-08-14  0:16 Emanuel Berg
  2017-08-14 21:49 ` Emanuel Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Emanuel Berg @ 2017-08-14  0:16 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-15 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-14  0:16 playing sounds from Emacs Emanuel Berg
2017-08-14 21:49 ` Emanuel Berg
2017-08-15 10:29   ` Marcin Borkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).