use strict; use Win32::Sound; # the params are the lower and upper range - #i.e. what is the least and most possible seconds for either the music/silence stage? my $min = $ARGV[0]; my $max = $ARGV[1]; my $sound = Win32::Sound::Volume(); while(1){ sleep int((rand($max-$min)+0.5)+$min); Win32::Sound::Volume() ? (Win32::Sound::Volume(0)) : (Win32::Sound::Volume($sound)); } __END__ 4, 9 seem okay params