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?"

26 of 156 comments (clear)

  1. Random sounds? by Anonymous Coward · · Score: 5, Insightful

    Is this what Ask Slashdot has boiled down to - asking about playing random sounds when email arrives? There's gotta be better material to pick from than this.

  2. I'm not a programmer but.. by LennyDotCom · · Score: 2, Insightful

    If there are no programs to do this already how about a program that renames teh files in a folder to a specified name randomly ? then you set outlook to what ever name you have set. Unless of course outlook caches the sound.

    --
    http://Lenny.com
  3. hmm... by sycotic · · Score: 4, Interesting

    set windows to play a sound eg. c:\sounds\newmail.wav and then have a folder with a number of wave files in it eg. c:\sounds\collection and schedule tasks to copy sounds to c:\sounds\newmail.wav every X minutes/seconds/whatever ?

    pretty clunky but relatively simple for the average bear

    --
    -- If I were a fish, I'd be wet
  4. 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?
  5. why the FUCK by Anonymous Coward · · Score: 2, Funny

    are you asking about outlook on slashdot?
    go use thunderbird.

    1. Re:why the FUCK by QuantumG · · Score: 3, Funny

      Another paid attempt to get Slashdot readers to hate Microsoft less.

      --
      How we know is more important than what we know.
  6. Re:slashdot is soooo dead by real_smiff · · Score: 4, Insightful

    also, it's farking stupid. the point of a new mail sound (or any event sound) is to have a sound that you know means new mail. if you've got apps making random sounds, how are you meant to know what's going on.
    probably why no mail app has such a feature.
    oh sorry, it would be "entertaining" :p

    --

    This is my Sig, this is my Gun. One is for Slashdot and one is for Fun.

  7. Ooh! What a great idea! by Datoyminaytah · · Score: 4, Funny

    I like! In fact, I like it so much, I think I'll assign random sounds to ALL system events!

    [click][click][clickity][click]

    Done!

    SPROING!!!

    Oh! I've got an email! Um...no, wait - what was that? Maybe an instant message...nope. Oh no! It's an illegal oper@*^!>$?%_)#&=

    --
    assert(birth_date<time-86400)
  8. Score; -5 Banal by Anonymous Coward · · Score: 2, Funny

    I thought I had seen it all but, this is BY FAR the lamest Ask Slashdot I have ever seen. The Article needs to be moderated -5 Banal.

    How to rotate notification sounds? In Microsoft Outlook?? On Slashdot????

    Dear Slashdot, how can I cause this person to receive a severe electric shock everytime a new message arrives in his Outlook inbox?

  9. 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.

  10. Wow by Goo.cc · · Score: 2, Insightful

    Without trying to disrespect the submitter, I can't believe this is a Ask Slashdot topic. Certainly this would have been better answered on a Windows related forum.

  11. Re:Just write an AppleScript... by 1Oman · · Score: 2, Interesting

    You do realise Outlook and Outlook Express are two different products right.

  12. let's get this out of the way. took me 3 mins. by croddy · · Score: 2, Informative

    #!/bin/sh
    # updates the sound list

    path=$1

    find $path -name "*.[Oo][Oo][Gg]" -print > soundlist.txt
    find $path -name "*.[Mm][Pp][3]" -print >> soundlist.txt
    find $path -name "*.[Ww][Aa][Vv]" -print >> soundlist.txt
    find $path -name "*.[Ff][Ll][Aa][Cc]" -print >> soundlist.txt
    find $path -name "*.[Aa][Ii][Ff][Ff]" -print >> soundlist.txt

    #!/bin/sh
    # play random file from filelist

    filelist=$1

    len=`wc -l $filelist`
    n=`expr $RANDOM % $len`
    play `sed -n ${n}p $filelist`

  13. No Problem by RealityMogul · · Score: 3, Funny

    Be glad to help - just give me your e-mail address and I'll send you over an executable. I'll even be so nice as to include an MD5 hash so you know its secure.

  14. Try a free program by AuMatar · · Score: 5, Funny

    from Claria. Nothing makes a Windows PC do random shit faster.

    --
    I still have more fans than freaks. WTF is wrong with you people?
  15. ... Use the Macros by johnnliu · · Score: 4, Interesting

    In Outlook, press ALT-F11
    Write your macro that plays your sound file.

    Go to your Rules & Alerts
    Create a rule for receiving emails - to play your Macro.

    Bonus point.
    Make your macro play a random sound.

    I think the whole effort should take about 5 minutes.

    1. Re:... Use the Macros by BJH · · Score: 2, Funny

      Surely that's ALT-F4?

  16. This is better than the Ask Slashdot I submitted.. by Tezkah · · Score: 4, Funny

    This is better than the Ask Slashdot I submitted, where I wanted to find out a way for thunderbird to play a random sound every time my RSS feed picks up a new Slashdot story.

    I settled for comic book guy saying "Worst. Slashdot. Story. EVER."

    Surprisingly its true every time!

  17. Re:Come on.. by atomic-penguin · · Score: 2, Funny

    Dear Slashdot, Should I have Pop-Tarts or cereal for breakfast?

    Slashdot (makes poor attempt to answer question but just ends up rambling): First it really depends on whether we are talking about frosted, non-frosted pop-tarts and of course we have to account for flavor variety. Second what distribution of cereal are you using since some varieties have more technical merit than others. In my not so humble opinion Cereal in general is the better technical choice since it provides 19 essential vitamins & minerals to get a good start on the day. On the other hand nobody knows what Pop-Tarts contain (other than something called high-fructose corn syrup) or what they provide you with from a nutritious diet point-of-view.

    QED (end ramble) Cereal obviously!

    --
    /^([Ss]ame [Bb]at (time, |channel.)){2}$/
  18. 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.

  19. Re:slashdot is soooo dead by dasunt · · Score: 2, Informative

    Not necessarily so.

    Imagine different pools of sound files. For example, one pool could be Futurama quotes. The other could be excerpts from Monty Python.

    Why you get new mail, it grabs a 'random' Futurama wav. When you have a new IM message, it grabs a 'random' Monty Python wav.

    As long as you have two brain cells to rub together, you can figure out that 'Bite my shiny metal ass' is new mail, while 'Ni!' is a new IM message.

  20. Skip the boing old alert sound - go festival by Bitsy+Boffin · · Score: 2, Interesting

    I used to have alert sounds on my email system, but it got really tedious, because I get lots of mail and most of it can wait, while some of it is important enough that I must look at it there and then (think important clients, not so important clients) - every time the alert went off, I'd have to stop what I was doing, go to the mail software, check to see what the message was and if it was important enough to deal with there and then.

    So anyway I had a bit of a brainwave one day - I hooked up festival (the voice synthesis software) to Evolution (my preferred mail client) and now instead of non-informational alert sounds I have festival read out-loud the sender and subject.

    It's probably the best thing since sliced bread as far as I'm concerned (I've had it like this for, umm, about a year I guess, and it's still very cool). Now when an email comes in I don't have to stop what I'm doing, I know if it's important enough to go look at because my PC tells me :)

    Even better..like all good geeks I have my PC running 24/7 a couple of meters from my bed (and like all good geeks I'm the only one in my bed), so no more do I have to get up and go see what the email was if I'm in bed :) Strangely enough I find I often sort of half-wake up in time to hear the subject being read to me even in the middle of the night (perhaps the hard drive churning before as fest starts up etc wakes me slightly).

    Most useful thing... ever. Perhaps I should patent it ;)

    --
    NZ Electronics Enthusiasts: Check out my Trade Me Listings
  21. Here is the code by FriedTurkey · · Score: 2, Informative

    Step 1 - Lower your macro security.

    Step 2 - Close Outlook and restart Outlook.

    Step 3 - Open up the Visual Basic editor.

    Step 4 - Add this in the code session of "ThisOutLookSession".

    Step 5 - Reformat the thing. I spent more time trying get it through the Slashdot filters than writing it.

    Private Declare Function PlaySound Lib "winmm.dll" _ Alias "PlaySoundA" (ByVal lpszName As String, _ ByVal hModule As Long, ByVal dwFlags As Long) As Long Function GetAllFilesInDir(ByVal strDirPath As String) As Variant ' Loop through the directory specified in strDirPath and save each ' file name in an array, then return that array to the calling ' procedure. ' Return False if strDirPath is not a valid directory. Dim strTempName As String Dim varFiles() As Variant Dim lngFileCount As Long On Error GoTo GetAllFiles_Err ' Make sure that strDirPath ends with a "\" character. If Right$(strDirPath, 1) "\" Then strDirPath = strDirPath & "\" End If ' Make sure strDirPath is a directory. If GetAttr(strDirPath) = vbDirectory Then strTempName = Dir(strDirPath, vbDirectory) Do Until Len(strTempName) = 0 ' Exclude ".", "..". If (strTempName ".") And (strTempName "..") Then ' Make sure we do not have a sub-directory name. If (GetAttr(strDirPath & strTempName) _ And vbDirectory) vbDirectory Then ' Increase the size of the array ' to accommodate the found filename ' and add the filename to the array. ReDim Preserve varFiles(lngFileCount) varFiles(lngFileCount) = strTempName lngFileCount = lngFileCount + 1 End If End If ' Use the Dir function to find the next filename. strTempName = Dir() Loop ' Return the array of found files. GetAllFilesInDir = varFiles End If GetAllFiles_End: Exit Function GetAllFiles_Err: GetAllFilesInDir = False Resume GetAllFiles_End End Function Private Sub Application_NewMail() Const SND_SYNC = &H0 Const SND_ASYNC = &H1 Const SND_FILENAME = &H20000 Dim varFileArray As Variant Dim lngI As Long Dim strDirName As String Const NO_FILES_IN_DIR As Long = 9 Const INVALID_DIR As Long = 13 On Error GoTo Test_Err strDirName = "C:\windows\media" varFileArray = GetAllFilesInDir(strDirName) For lngI = 0 To UBound(varFileArray) Debug.Print varFileArray(lngI) Next lngI lngI = Math.Round(Math.Rnd() * UBound(varFileArray)) WAVFile = "C:\windows\media\" & varFileArray(lngI) Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME) Test_Err: Select Case Err.Number Case NO_FILES_IN_DIR MsgBox "The directory named '" & strDirName _ & "' contains no files." Case INVALID_DIR MsgBox "'" & strDirName & "' is not a valid directory." Case 0 Case Else MsgBox "Error #" & Err.Number & " - " & Err.Description End Select End Sub

    Step 6 - Ignore all replies to this post. They are all the same Microsoft bashing crap you've already read 1000 times on /.

    Step 7 - If you think this is some kind of virus learn to code and then you can check it yourself.

    Step 8 - Fix the API call. It is too slow.

  22. OK, instructions for Outlook by leonbrooks · · Score: 2, Interesting

    0. save all user data from computer
    1. install Mandrake Linux or similar over the top of Outlook and MS-Windows
    2. restore user data
    3. configure KMail or Evolution to play random sounds
    4. problem solved. forever.

    --
    Got time? Spend some of it coding or testing
  23. laughin at'cha, ha ha haaa by starakurva · · Score: 2, Funny

    So how's this for a deal:

    I'll piss off to where I want to go, and you guys can stay right here in the best goddamn country in the whole wide world, mmkay?

    btw: real appropriate username you two have got...do your SUVs with the "USA ribbons" on it have tinted glass too? We know you're on your cell phones anyway, by the way you ride the center line....

    You're prolly the ones trying to change your outlook sounds lol

    --
    All you need is lurv.
  24. Shitty way of doing it... by Oculus+Habent · · Score: 2, Informative

    Make a folder of the sounds you want.

    Copy one of them and name it "sound.wav" or somesuch.

    Make a Scheduled Task that runs every minute.

    When "sound.wav"'s Last Accessed time is within the minute, have it randomly select a new sound and overwrite "sound.wav".

    --
    That what was all this school was for... to teach us how to solve our own problems. -- janeowit