LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 03-24-2006, 12:31 PM   #16
Ipsofacto
Member
 
Registered: Sep 2005
Distribution: Arch
Posts: 132

Rep: Reputation: 15

Quote:
Originally Posted by Xswitch
> sleep xxx; mplayer xxx.mp3 worked like a charm.
Good to know - I use xmms-alarm to (help me!) get out of bed and its been temperamental lately, may try this method instead.
 
Old 03-24-2006, 02:22 PM   #17
linuxbot
LQ Newbie
 
Registered: Mar 2006
Posts: 11

Rep: Reputation: 0
Just for fun

Glad I could help Xswitch. I learned some too. I didn't realize all the stuff sox could do, the effects and mixing are pretty cool.
http://sox.sourceforge.net/
http://dsl.org/cookbook/cookbook_29.html#SEC404


Here's a little script I put together. It'll play a random sound file at a random time. To use it, do this:
1) Put it in a file called something like rndplay in your /home/<username>/bin directory.
2) At a shell window (command prompt), cd to a directory containing a bunch of sound files (wav or mp3).
3) Run the command:
> rndplay *.wav

Adjust the mintime and maxtime to your liking.
Substitute the play command near the bottom for mplayer or whatever command is working for you.

I like to run it on the Looney Tunes sound clips I collected, listen to Bugs, Daffy, PorkyPig, etc. spout off.

Disclaimer: no guarantees that it will work and use at your own risk.

> Shell script - copy after this line <
# play random sound files at random time
# works with a list of files up to 32767 files

# configuration
# min and max time delay in seconds
mintime=60
maxtime=3600

# calc the random values
max=$(($maxtime - $mintime + 1))

# count the files
filecount=`ls $* | wc -l`

echo "-----------------------------------------"
echo "Total number of sound files = $filecount"
echo "Minimum Delay = $mintime seconds"
echo "Maximum Delay = $maxtime seconds"

# infinite loop
while :
do
# pick a random time
rdmtime=$((RANDOM%$max+$mintime))

# pick a random file number
rdmfilenum=$((RANDOM%$filecount+1))

count=0

for file in `ls $*`
do
count=$(($count + 1))
if [ $count -eq $rdmfilenum ]
then
pickfile=$file
break
fi
done

# Calc hours, minutes, and seconds
hrs=$(($rdmtime/3600))
mins=$((($rdmtime % 3600) / 60))
secs=$((($rdmtime % 3600) % 60))

echo "-----------------------------------------"
echo "Random number of sound file = $rdmfilenum"
echo "Sound File to play = $pickfile"
echo "Time Delay = $rdmtime secs ($hrs:$mins:$secs)"

# Wait the time delay
sleep $rdmtime
# Play the sound file
play $pickfile

done
 
Old 03-27-2006, 09:06 AM   #18
linuxbot
LQ Newbie
 
Registered: Mar 2006
Posts: 11

Rep: Reputation: 0
Quote:
Originally Posted by Ipsofacto
Good to know - I use xmms-alarm to (help me!) get out of bed and its been temperamental lately, may try this method instead.

Ipsofacto,

Try the at command. It submits user jobs to be executed by cron. Make sure you have atd running, YAST > System > Runlevel Editor > atd enable.

Then run at the command line:

> echo 'play file.wav' | at 6:00

at takes commands from the standard input (for from a script file) so the above echo feeds it the command. You can also give at a date, but in the above example if it's after 6:00 when you execute the command, at assumes the next day.

To view your at queue:
> at -l

To list the commands in an at job:
> at -c <job id>
 
Old 03-29-2006, 12:20 AM   #19
Ipsofacto
Member
 
Registered: Sep 2005
Distribution: Arch
Posts: 132

Rep: Reputation: 15
Thanks for this Linuxbot - I'll give it a try tonight.
 
Old 03-29-2006, 07:39 AM   #20
Xswitch
Member
 
Registered: Jul 2003
Distribution: Ubuntu, Debian
Posts: 139

Original Poster
Rep: Reputation: 15
Very interesting stuff.... Thanks again... I'll definitely be experimenting. Right now, I'm just trying to get functional. I still don't quite get repositories. I bought SuSE 10 online and have read some of the posts here about repositories, but I still don't know how or what should go in that list for updating. Everythging seems to be geared for OpenSuSE... I don't have OpenSuSE, I purchased the boxed ver. If you guys could help me with this, would be great. Thanks again...
 
Old 03-29-2006, 07:53 AM   #21
Ipsofacto
Member
 
Registered: Sep 2005
Distribution: Arch
Posts: 132

Rep: Reputation: 15
See the following link. If you use the packman and guru repositories you will be good to go, although if you are using KDE I would also include the Novell link.

http://www.novell.com/coolsolutions/feature/16592.html
 
Old 03-29-2006, 08:55 AM   #22
Xswitch
Member
 
Registered: Jul 2003
Distribution: Ubuntu, Debian
Posts: 139

Original Poster
Rep: Reputation: 15
Thanks a ton Ipsofacto... Very much appreciated... =^)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stopwatch for Linux... deft Linux - Software 5 03-01-2006 06:15 AM
LXer: Open Source Software Will Permeate Enterprise Software, Says The ... LXer Syndicated Linux News 0 12-12-2005 08:31 PM
Music Library Software & a List of M$ like Software for Linux MultiUser Linux - Software 2 02-27-2004 08:20 PM
stopwatch rsarson General 4 08-27-2003 08:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 02:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration