Slashdot Mirror


Play Random Sounds for E-Mail Notifications?

An anonymous reader asks: "I, like many of my fellow Outlook-using geek friends, like to set funny sounds to be played when a new message arrives ('Leeroy Jenkins' is the one I have set now). However, we have always wanted to be able to have random sounds be played when a new message arrives, rather than the same sound over and over. I've searched high and low, and I was hoping Slashdot could suggest/write a program that can randomly play sound files from a specified folder when a new message arrives. Any ideas?"

3 of 156 comments (clear)

  1. Ideas if there isn't software to do this by biglig2 · · Score: 4, Informative

    Use a seperate new e-mail notification program (that plays random sounds) in parallel to outlook.

    Or write a script that occasionally copies a random WAV to notify.wav (which is what outlook plays).

    BTW, the place to start looking for outlook info is the excellent slipstick.com

    --
    ~~~~~ BigLig2? You mean there's another one of me?
  2. Perl... by RedPhoenix · · Score: 3, Informative

    #!/usr/bin/perl
    $SOUNDDIR="/usr/share/sounds";
    $ DESTFILE="/tmp/sound.wav";
    opendir(DIR,$SOUNDDIR) || die "Can't open $SOUNDDIR: $!\n";
    $count=0;
    while(defined($file = readdir(DIR))) {
    if($file =~ /\.wav$/) {
    $files[$count]=$file;
    $count++;
    }
    }

    $arraysize=@files;
    while(1) {
    $rnd=int(rand($arraysize));
    $filename=$files[$rnd];
    `cp $SOUNDDIR/$filename $DESTFILE`;
    sleep 10;
    }

    Mangle appropriately (source dir, sleep time, dest file, file-type).

    Have fun.

    Red.

  3. Random audio files in Outlook 2002 for dummies by LordEd · · Score: 4, Informative

    1. Write a simple application/script that plays a random sound file
    - Read directory and store files in a list/array
    - Use a random function to pick a wav file
    - Load and play the selected audio file

    2. Disable e-mail sound notifications (Tools->Options->Email options->Advanced email options->uncheck 'play a sound'

    3. Set up a rule for incoming email: (Tools->Rules wizard->New.
    Start from a blank rule. Check messages when they arrive (next).
    (Next) and confirm to apply to all rules.
    Check 'start application'. Click the underlined 'application'. Choose your custom app (open).
    (next)(next).
    Name the rule 'sound script'
    (finish)(ok).

    To prevent your script from playing sounds for every email received, put a delay counter on it to prevent multiple instances of the same application, or some form of lock preventing concurrent running.