What's the best way to play a short audio clip (e.g., an alarm bell) from a BASH script? At the moment I'm using totem, but it's overkill to have its GUI start up! I'd prefer just a simple command for one-off playing of an audio clip.
What's the best way to play a short audio clip (e.g., an alarm bell) from a BASH script? At the moment I'm using totem, but it's overkill to have its GUI start up! I'd prefer just a simple command for one-off playing of an audio clip.
Hi
You could use mplayer, like this:-
Code:mplayer <filename>
Thanks. Suppressing stdout and stderr, the following worked just fine:
#!/bin/bash
(sleep ${1:-240}; mplayer /usr/share/sounds/phone.wav >/dev/null 2>&1) &
Last edited by minus24; July 22nd, 2008 at 11:13 PM.
In OS X the player command is afplay
More at http://hints.macworld.com/article.ph...81002080543392
Bookmarks