Sponsored Content
Full Discussion: crontab+mplayer alarm clock
Top Forums Shell Programming and Scripting crontab+mplayer alarm clock Post 302682227 by agama on Sunday 5th of August 2012 10:16:46 PM
Old 08-05-2012
Quote:
Originally Posted by hbar
@agama.

Putting a baclslash makes it work. Thanks. However, voume does not keep on increasing!

@Corona688

I'm using gnome desktop in ubuntu 12.04. I copied the structure from the internet and many places \dev\null is mentioned. Now, as I just said, it's working but volume is not increasing by 10% !
The way you have your command written, I wouldn't expect the volume to increase. The mixer command is invoked once, and if successful (&&) mplayer is invoked to play the mp3 looping through it 5 times.

If you want to bump the volume with each cycle through the file I would write a small script (alarm.bash or somesuch) and invoke that from cron. The script would look something like this:

Code:
#!/usr/bin/env bash
PLAYER=/usr/bin/mplayer
SONG=/home/hbar/Music/song.mp3

/usr/bin/amixer sset Master 35% >/dev/null 2>&1  # start with a default volume maybe??

for (( i = 0; i < 5; i++ ))
do
   /usr/bin/amixer sset Master 10%+ >/dev/null 2>&1
   $PLAYER -really-quiet -vo null $SONG >/dev/null 2>&1
done

In addition to Carona's suggestion, I'd toss in -really-quiet to cut the overhead of updates directed to /dev/null.

Last edited by agama; 08-05-2012 at 11:25 PM.. Reason: typo/added default volume setting
 

3 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

alarm

Hello I have a server HP ES40 with unix 5.1B, and if i open from Start-Programs-IN Tools-GUI/pfmalarm/Alarm-start monitoring , I receive this error message "IOR : STRING IS TOO LONG ! MAXIMUM SIZE = 1024" Anybody heard about this error? Thanks Alin (0 Replies)
Discussion started by: tomaalin
0 Replies

2. Shell Programming and Scripting

Scripting an alarm

Hi All, I am monitoring batch Processes running in UNIX environment. I use PuTTy to monitor the process running. I have to continuously monitor and look on the screen if some error has come or not. If an error comes FAILURE word is displayed instead of SUCCESS as shown below on the... (2 Replies)
Discussion started by: sampandey31
2 Replies

3. Shell Programming and Scripting

Alarm clock error while executing the script

I am executing perl script on Linux machine and the script is running for the last 5 hours and while running the script I had an error message in a single line Alarm Clock and the script got stopped. I havnt scheduled the script.I have executed the script manually. There is no syntax errors in... (1 Reply)
Discussion started by: scriptscript
1 Replies
getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

NAME
getusershell, setusershell, endusershell - get legal user shells SYNOPSIS
#include <unistd.h> char *getusershell(void); void setusershell(void); void endusershell(void); DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, the following locations of the standard system shells are used in its place: /bin/bash /bin/csh /bin/jsh /bin/ksh /bin/pfcsh /bin/pfksh /bin/pfsh /bin/sh /bin/tcsh /bin/zsh /sbin/jsh /sbin/pfsh /sbin/sh /usr/bin/bash /usr/bin/csh /usr/bin/jsh /usr/bin/ksh /usr/bin/pfcsh /usr/bin/pfksh /usr/bin/pfsh /usr/bin/sh /usr/bin/tcsh /usr/bin/zsh /usr/xpg4/bin/sh The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells. The setusershell() function rewinds the file or the list. The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells. RETURN VALUES
The getusershell() function returns a null pointer on EOF. BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved. SunOS 5.10 30 Aug 2004 getusershell(3C)
All times are GMT -4. The time now is 02:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy