all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <moasen@zoho.com>
To: help-gnu-emacs@gnu.org
Subject: playing sounds from Emacs
Date: Mon, 14 Aug 2017 02:16:46 +0200	[thread overview]
Message-ID: <86bmnjt34h.fsf@zoho.com> (raw)

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	other threads:[~2017-08-14  0:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14  0:16 Emanuel Berg [this message]
2017-08-14 21:49 ` playing sounds from Emacs Emanuel Berg
2017-08-15 10:29   ` Marcin Borkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86bmnjt34h.fsf@zoho.com \
    --to=moasen@zoho.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.