Increase volume in steps


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Increase volume in steps
# 1  
Old 08-18-2018
Increase volume in steps

I would like to modify this so the buzzer starts at 15% and goes up to 30% in volume while it is playing.

Code:
amixer -D pulse sset Master 30% > /dev/null 2>&1  
cvlc --play-and-exit /usr/share/sounds/My_Sounds/Alarm-sound-buzzer.mp3 > /dev/null 2>&1  
echo 'TIME IS UP.' gxmessage -fg blue -font  'sans 20' -timeout 2 ' TIME IS UP !!'

I tried using code tags, but it ended up as one line.

Last edited by Scrutinizer; 08-18-2018 at 06:50 PM.. Reason: Added code tags ....
# 2  
Old 08-18-2018
Since these are Linux apps you are using, sleep 500m means sleep 500 milleseconds or one half of a second

Code:
# bump.shl
# increase volume by 5% every half second - in background
 for (( i=0 i<5; i++))
 do
  amixer sset Master 5%+
  sleep 500m
done

Code:
amixer -D pulse sset Master 15% > /dev/null 2>&1  
# call child process
/path/to/bump.shl &
pid=$!
cvlc --play-and-exit /usr/share/sounds/My_Sounds/Alarm-sound-buzzer.mp3 > /dev/null 2>&1  
echo 'TIME IS UP.' gxmessage -fg blue -font  'sans 20' -timeout 2 ' TIME IS UP !!'
# clean up child if needed
kill -0 $pid && kill $pid
wait

These 2 Users Gave Thanks to jim mcnamara For This Post:
# 3  
Old 08-19-2018
Volume starts at 15% and ends at 15%.

What permissions should I give bump.shl?

Code:
andy@7_~/Downloads$ t1.sh 5
/home/andy/bin/t1.sh: line 9: /home/andy/bin/bump.shl: Permission denied
/home/andy/bin/t1.sh: line 14: kill: (3024) - No such process

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

No space in volume group. How to create a file system using existing logical volume

Hello Guys, I want to create a file system dedicated for an application installation. But there is no space in volume group to create a new logical volume. There is enough space in other logical volume which is being mounted on /var. I know we can use that logical volume and create a virtual... (2 Replies)
Discussion started by: vamshigvk475
2 Replies

2. AIX

Increase filesystem and or logical volume

Hi all, Do i need to increase the logical volume each time i increase the filesystem? or is enough to increase the filesystem and the logical volume get increase automatically? extendlv hd4 1 chfs -a size=2G /tmp or just chfs -a size=2G /tmp Code tags! (4 Replies)
Discussion started by: prpkrk
4 Replies

3. AIX

Position of the logical volume on the physical volume

Hello everyone, I just read that while creating a logical volume(LV) we can choose the region of the physical volume (PV) in which the LV should be created. When I say region I mean: outer edge - outer middle - center - inner middle and inner edge. Can anyone help me understand the utility... (11 Replies)
Discussion started by: adilyos
11 Replies

4. UNIX for Dummies Questions & Answers

Confusion Regarding Physical Volume,Volume Group,Logical Volume,Physical partition

Hi, I am new to unix. I am working on Red Hat Linux and side by side on AIX also. After reading the concepts of Storage, I am now really confused regarding the terminologies 1)Physical Volume 2)Volume Group 3)Logical Volume 4)Physical Partition Please help me to understand these concepts. (6 Replies)
Discussion started by: kashifsd17
6 Replies

5. HP-UX

Increase Size of a Volume Group

Hi I have hp-ux 10.20 I have have my operating system VG of 7 GB in a 36Gb disk. So I have like 29GB of unused disk space. There is any way to increase my VG size, or to add another VG in the same disk so I can use all the disk space? Another question, what is the maximun size that a VG can ... (10 Replies)
Discussion started by: pmoren
10 Replies

6. UNIX for Dummies Questions & Answers

VERITAS Volume Manager - mirror a disk/volume

I have a machine (5.10 Generic_142900-03 sun4u sparc SUNW,Sun-Fire-V210) that we are upgrading the storage and my task is to mirror what is already on the machine to the new disk. I have the disk, it is labeled and ready but I am not sure of the next steps to mirror the existing diskgroup and... (1 Reply)
Discussion started by: rookieuxixsa
1 Replies

7. AIX

Basic Filesystem / Physical Volume / Logical Volume Check

Hi! Can anyone help me on how I can do a basic check on the Unix filesystems / physical volumes and logical volumes? What items should I check, like where do I look at in smit? Or are there commands that I should execute? I need to do this as I was informed by IBM that there seems to be... (1 Reply)
Discussion started by: chipahoys
1 Replies

8. Solaris

How to resize mirror volume in veritas volume manager 3.5 on Solaris 9 OE

Hi all, I have a problem with vxvm volume which is mirror with two disks. when i am try to increase file system, it is throwing an ERROR: can not allocate 5083938 blocks, ERROR: can not able to run vxassist on this volume. Please find a sutable solutions. Thanks and Regards B. Nageswar... (0 Replies)
Discussion started by: nageswarb
0 Replies

9. UNIX for Advanced & Expert Users

LVM - Extending Logical Volume within Volume Group

Hello, I have logical volume group of 50GB, in which I have 2 logical volumes, LogVol01 and LogVol02, both are of 10GB. If I extend LogVol01 further by 10GB, then it keeps the extended copy after logical volume 2. I want to know where it keeps this information Regards Himanshu (3 Replies)
Discussion started by: ghimanshu
3 Replies

10. UNIX for Advanced & Expert Users

How to increase PV's in a Volume group ?

I have a Volume group on one of my production box. The no of PV's within the same is 16 which I need to increase. How can this be done ? Can this be done online or do we need a downtime for this ? Please provide the exact details and steps for this activity urgently, as need to do this on my... (3 Replies)
Discussion started by: kpatel786
3 Replies
Login or Register to Ask a Question