Register
It is currently Thu Oct 23, 2014 5:00 am

sound file with bash script


All times are UTC - 6 hours


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPosted: Thu Sep 13, 2012 12:14 pm   

Joined: Fri Aug 03, 2012 2:07 pm
Posts: 20
i have a script that needs to play a sound or alert at a certain point while running. how do i bundle a sound file with my script and then when the script is running, call the soundfile? is it possible? by the way, what sound formats does bash support if this is possible. thanks.


Top
 Profile  
 PostPosted: Thu Sep 13, 2012 4:27 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 550
you need an external program, like `aplay'.


Top
 Profile  
 PostPosted: Sat Sep 15, 2012 9:34 am   

Joined: Fri Aug 03, 2012 2:07 pm
Posts: 20
do i need a package utility? like if one has to download the script


Top
 Profile  
 PostPosted: Sat Sep 15, 2012 6:02 pm   
User avatar

Joined: Wed Jun 08, 2011 8:27 am
Posts: 189
Location: outer Shpongolia
Check if e.g., aplay(1) is installed on the system, and if not warn the user.

Code:
if ! type -p aplay > /dev/null; then
    echo 'E: aplay(1) has to be installed in order to continue.' >&2
    exit 1
fi


Top
 Profile  
 PostPosted: Mon Sep 17, 2012 1:11 pm   

Joined: Fri Aug 03, 2012 2:07 pm
Posts: 20
yeah, that is an absolute must. I was wondering if i could beat the ability of uploading the script on an archive with the sound file in the archive so that that the user could manually copy the file to his $HOME/Music directory or another directory of his choosing.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP