Page 1 of 2 12 LastLast
Results 1 to 30 of 40

Thread: A command line tool for Windows which beeps through the System Speaker

  1. #1
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts

    A command line tool for Windows which beeps through the System Speaker

    Well, as title says, I'm searching for a command line tool for Windows which beeps through the System Speaker. The deal is that I gonna conduct some long running tests this night and since they oriented for speed measurement then I'm probably will be lie at the sofa and read the book. Since my sofa somehow away from PC and I'm always turning off the monitor then I'll not be able to visually observe the test status. The presence of such tool in my BAT file will allow to alarm me when test is finished. I've googled for such tool but found only these:

    http://my.opera.com/zomg/blog/2007/0...the-pc-speaker

    Well, its for Windows but it doesn't work for me although I've tried different ways to use it.

    http://johnath.com/beep/
    http://wiki.przemoc.net/projects/pcspk

    These two links somehow connected. PCSPK is based on BEEP. Seems both for Linux and sources are available but no WIN executables.

    Does anybody knows something which can help me ?

  2. #2
    The Founder encode's Avatar
    Join Date
    May 2006
    Location
    Moscow, Russia
    Posts
    3,954
    Thanks
    359
    Thanked 332 Times in 131 Posts
    Are you sure that your PC has internal speaker?

    My main PC has no such thing...

  3. #3
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    Sure. Just tested it by quickly pressing SHIFT 5 times

  4. #4
    Programmer osmanturan's Avatar
    Join Date
    May 2008
    Location
    Mersin, Turkiye
    Posts
    651
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this on commandline:
    Code:
    rundll32 user32.dll,MessageBeep -1
    If you don't like the sound then try to change last parameter one of them listed parameters below:
    Code:
    -1
    A simple beep. If the sound card is not available, the sound is generated using the speaker.
    MB_ICONASTERISK
    0x00000040L
    See MB_ICONINFORMATION.
    MB_ICONEXCLAMATION
    0x00000030L
    See MB_ICONWARNING.
    MB_ICONERROR
    0x00000010L
    The sound specified as the Windows Critical Stop sound.
    MB_ICONHAND
    0x00000010L
    See MB_ICONERROR.
    MB_ICONINFORMATION
    0x00000040L
    The sound specified as the Windows Asterisk sound.
    MB_ICONQUESTION
    0x00000020L
    The sound specified as the Windows Question sound.
    MB_ICONSTOP
    0x00000010L
    See MB_ICONERROR.
    MB_ICONWARNING
    0x00000030L
    The sound specified as the Windows Exclamation sound.
    MB_OK
    0x00000000L
    The sound specified as the Windows Default Beep sound.
    BIT Archiver homepage: www.osmanturan.com

  5. #5
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    Thanks for suggestion man but it doesn't work for my system. The last thing I was able to found is:

    http://fly.cc.fer.hr/GDM/articles/sndmus/speaker1.html
    http://fly.cc.fer.hr/GDM/articles/sndmus/speaker2.html
    http://fly.cc.fer.hr/GDM/articles/sn...es/speaker.zip

    The SOUNDS.EXE file from speaker.zip works but it requires that you press some key before its demo starts. Continuing searching...

  6. #6
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Does this work on your PC?

    EDIT: Attachment "beep_test.zip" removed.

  7. #7
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    OHH YEHHH ! It works !!!
    Huge thanks from me

    I'm also found this working one:
    http://www.frank-buss.de/beep/index.html
    http://www.frank-buss.de/beep/beep.exe (direct link to exe)

    It works with following syntax: beep <frequency in Hz> <duration in ms>
    I've also tested capabilities of my PC Speaker and found that it able to reproduce frequencies in range of 37-14500 Hz

    Once again, thank you LovePimple and osmanturan for your participation and help. Hooray!

  8. #8
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Thumbs up

    I was writing one specially for you (~20 minutes), but you had already found a solution before I finished. You may as well have it anyway...

    ENJOY!

    Regards,
    LovePimple


    EDIT: Replaced v0.1 with v0.2. Cleaned up code a little, and added sensible min/max frequency parameter checks for command line.

    EDIT: Replaced v0.2 with v0.3. Added duration setting, changed min/max frequency parameters, and updated command line help.

    EDIT: Replaced v0.3 with v0.4. Added default beep when no parameters are specified at command line. You now need to use "/?" or "-h" to view help text. Changed all references and filenames from "Winbeep" to "beep". Note: Default beep should work even under Windows Vista x64 and Windows XP 64-Bit Edition.

    EDIT: Replaced v0.4 with v0.5. Changed name to 'BUZZER' due to a request from Skymmer.

    EDIT: Replaced v0.5 with v0.6. Added repeats/repeat rate. Removed default beep - decided I didn't like it.

    EDIT: Replaced v0.6 with v0.7. Modified the repeat beep/delay routine. Added beep until key press functionality for zero parameter. Updated command line help to reflect the changes.
    Attached Files Attached Files

  9. #9
    Programmer osmanturan's Avatar
    Join Date
    May 2008
    Location
    Mersin, Turkiye
    Posts
    651
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Skymmer View Post
    Once again, thank you LovePimple and osmanturan for your participation and help. Hooray!
    You're welcome. But, I really wonder what's your system!? It must be a pre-historic system if you can't run above code. Though, it should run on all windows platform. Really interesting...
    BIT Archiver homepage: www.osmanturan.com

  10. #10
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    Quote Originally Posted by LovePimple View Post
    I was writing one specially for you (~20 minutes), but you had already found a solution before I finished. You may as well have it anyway...

    ENJOY!

    Regards,
    LovePimple
    I am really flattered by it. But I wonder why you included the frequency table in console output. Somehow you guessed that I'm related to music writing so here is the track for you. I don't know if you like Drum'n'bass but anyway its just a little dedication. Enjoy!

    http://narod.ru/disk/9430814000/Skym...ailed.mp3.html

    Quote Originally Posted by osmanturan
    You're welcome. But, I really wonder what's your system!? It must be a pre-historic system if you can't run above code. Though, it should run on all windows platform. Really interesting...
    Windows XP Pro SP2 Eng which surely requires re-installing a long time ago.

  11. #11
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by Skymmer View Post
    I am really flattered by it. I don't know if you like Drum'n'bass but anyway its just a little dedication. Enjoy!

    http://narod.ru/disk/9430814000/Skym...ailed.mp3.html
    Thanks! I look forward to listening to it later today.

    Quote Originally Posted by Skymmer View Post
    Windows XP Pro SP2 Eng which surely requires re-installing a long time ago.
    Same as myself. Excellent operating system!

  12. #12
    Programmer osmanturan's Avatar
    Join Date
    May 2008
    Location
    Mersin, Turkiye
    Posts
    651
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've digged more and figured out that actually RunDLL32 has not similarities as I guessed. Same code didn't work on my WinXP SP2 Eng (VM) but it worked on my primary OS (Native Vista x64 Business). Strange...
    BIT Archiver homepage: www.osmanturan.com

  13. #13
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Exclamation

    @ Skymmer

    BEEP was updated about five minutes after v0.1 was uploaded. See the edit in my original post.

  14. #14
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    I've just looked into user32.dll exports and found that MessageBeep exist there. So probably the parameters are not accepted although I can be wrong

  15. #15
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    Quote Originally Posted by LovePimple View Post
    @ Skymmer

    BEEP was updated about five minutes after v0.1 was uploaded. See the edit in my original post.
    Excellent!

    Quote Originally Posted by LovePimple
    Cleaned up code a little, and added sensible min/max frequency parameter checks for command line.
    A little ? It's 38 times smaller
    The only thing is missing its a sound duration in ms. I mean BUZZER 1000 2000
    I'm also curious why its limited to 5000 hz upper cap?

    Anyway, thanks

  16. #16
    Programmer osmanturan's Avatar
    Join Date
    May 2008
    Location
    Mersin, Turkiye
    Posts
    651
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Skymmer View Post
    I've just looked into user32.dll exports and found that MessageBeep exist there. So probably the parameters are not accepted although I can be wrong
    Yes parameters are correct. But, RunDLL32 works other than I thought. I've read that you can only call a function which strictly written for RunDLL32. For final conclusion, I've also looked at ReactOS sources and voila! You can't call Win32 API with RunDLL32 unless they are written for supporting RunDLL32. Though, some Win32 API could still run.
    BIT Archiver homepage: www.osmanturan.com

  17. #17
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    I've just looked into LovePimple's BEEP. Its implemented via KERNEL32.dll,Beep
    Its OK but looking into at least here I found that the frequency range is 37 through 32767. Its also OK but I wonder why 37 have been chosen for lower limit. By the way 37 is one of the prime numbers.
    http://en.wikipedia.org/wiki/List_of_prime_numbers

  18. #18
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    Quote Originally Posted by LovePimple View Post
    BEEP has been updated to v0.3. See my original post for more details.
    Very nice! Thanks! Just tested it a little bit and seems OK.
    At current state its already the best beep tool available but If you want to create the world dominating beeper than here are couple suggestions from me:
    1.) additional parameteres [repeat rate] and [numbers of repeats]
    [repeat rate] in ms means, well repeat rate for given tone [numbers of repeats] is self-explainable too so for example with 260 500 1000 3 the 260 Hz tone with 500 ms lenght will be repeated every 1 sec. three times so we can trigger real alarms! If [numbers of repeats] is 0 (zero) than tone will be repeated until some key is pressed.
    2.) Is it possible to implement the sliding frequency? I mean 65-440
    3.) The name. I think BEEP is too trivial. Furthermore BEEP is already existing. My variants are: Beeper, Buzzer, BiP or even funny Beep-Beep!

    Anyway, thanks once again. I love such small tools with extraordinary functionality

    EDIT: Ohh, Just saw v0.4 but I'm going for a walk so will look later. Cool !

  19. #19
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Thumbs up

    Quote Originally Posted by Skymmer View Post
    1.) additional parameteres [repeat rate] and [numbers of repeats]
    [repeat rate] in ms means, well repeat rate for given tone [numbers of repeats] is self-explainable too so for example with 260 500 1000 3 the 260 Hz tone with 500 ms lenght will be repeated every 1 sec. three times so we can trigger real alarms! If [numbers of repeats] is 0 (zero) than tone will be repeated until some key is pressed.

    2.) Is it possible to implement the sliding frequency? I mean 65-440
    I will consider these suggestions for future updates.

    Quote Originally Posted by Skymmer View Post
    3.) The name. I think BEEP is too trivial. Furthermore BEEP is already existing. My variants are: Beeper, Buzzer, BiP or even funny Beep-Beep!
    OK, As from v0.5, BUZZER is born...

  20. #20
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Here's another little 'BEEP' type utility for you... This one uses the MessageBeep function to play a user specified selection of preset Windows sounds. It requires Windows 2000 or later, and should work even under Windows Vista x64 and Windows XP 64-Bit Edition.

    This one will work even if a PC has no internal speaker.


    ENJOY!

    Regards,
    LovePimple
    Attached Files Attached Files

  21. #21
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Or, you could create your own 'beep' sound as a wave file, and play it back with the WavBeep utility...

    Any one of these three utilities is ideal for use with batch files.


    EDIT: Attachment "WavBeep01.zip" removed.

  22. #22
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    WinBEEP
    At first attempt it didn't work for me. Then I remembered that I turned off Windows sound notifications but after I turned it on - nothing changed. Little later I remembered that I deleted all WAV files in Windows\Media folder so I rebooted into another reserve clean install OS (XP Pro Rus SP3) and everything became fine

    WavBEEP
    Honestly speaking I don't like its idea. I prefer to read in silence so keep my amplifier turned on and warming just waiting to play some short sequence is certainly not good but I've tested it a little bit and found some issues. Seems it doesn't play some sounds completely. For one 27 sec file it played only ~5.5 sec. (~20%) and for another 60 sec. one it played only 22.3 sec. (~37%)

    BUZZER
    Oh yeah! I love it
    Works fine. Thanks !

  23. #23
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Thanks for the feedback!

    Quote Originally Posted by Skymmer View Post
    WavBEEP
    Honestly speaking I don't like its idea. I prefer to read in silence so keep my amplifier turned on and warming just waiting to play some short sequence is certainly not good but I've tested it a little bit and found some issues. Seems it doesn't play some sounds completely. For one 27 sec file it played only ~5.5 sec. (~20%) and for another 60 sec. one it played only 22.3 sec. (~37%)
    This update should fix the problem. I used a batch file to test it on a full album of audio tracks converted to wave files. No problems encountered...

    EDIT: Attached a small wave file to use as WavBeep's default beep sound.
    Attached Files Attached Files

  24. #24
    Member
    Join Date
    Jun 2008
    Location
    USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    simple method

    Okay, I just had to mention this, even if just for laughs:

    C:\TEMP> echo ^G

  25. #25
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    Interesting tip, thanks. But although it works in console I wasn't able to wrap it into BAT file.

  26. #26
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Buzzer v0.6 has been released. See my original post for more info.

  27. #27
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    Quote Originally Posted by LovePimple View Post
    Buzzer v0.6 has been released. See my original post for more info.
    Charming! Thanks a lot !!! BUZZER almost rules the world
    I say almost because I've found a tiny bug. If you use n as [repeats] value then BUZZER buzzes n+1 times. I mean 4 instead 3 for example.

  28. #28
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by Skymmer View Post
    Charming! Thanks a lot !!! BUZZER almost rules the world
    I say almost because I've found a tiny bug. If you use n as [repeats] value then BUZZER buzzes n+1 times. I mean 4 instead 3 for example.
    This was intentional. It beeps once, then repeats n times. I can easily change this for the next release if you are not happy.

  29. #29
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    Aha. I follow your logic so from this point of view it would be better to rename repeats to number of beeps and repeat rate to delay between beeps. Also as I see repeats and repeat rate are optional parameters so if user don't use them then let BUZZER beep 1 time and if user assign repeats (number of beeps) value then let BUZZER beep this value times. Also, since some parameters are optional and other are mandatory then from cosmetical point of view it would be better to give the following console help:
    Code:
    BUZZER <frequency> <duration> [number of beeps] [delay between beeps]
    Also if user assign [number of beeps] but don't uses [delay between beeps] then BUZZER uses minimal 10 ms as default which is too small and basicly unnoticeable. I think 300 as default should be fine.

    Buzz buzz buzz

  30. #30
    Moderator

    Join Date
    May 2008
    Location
    Tristan da Cunha
    Posts
    2,034
    Thanks
    0
    Thanked 4 Times in 4 Posts
    OK! Buzzer v0.7 has now been released. I have updated it with all of your requested modifications apart from the 10 ms default delay. See my original post for more info.

Page 1 of 2 12 LastLast

Similar Threads

  1. UCLC (Ultimate Command Line Compressors) Benchmarks
    By osmanturan in forum Data Compression
    Replies: 2
    Last Post: 4th September 2015, 11:30
  2. compression trace tool
    By Shelwien in forum Data Compression
    Replies: 6
    Last Post: 19th August 2009, 03:52
  3. LZBW1 - compression tool by another newbye :)
    By stfox in forum Data Compression
    Replies: 4
    Last Post: 28th April 2009, 16:33
  4. a small plea for the command line compression developers
    By SvenBent in forum Data Compression
    Replies: 2
    Last Post: 14th June 2008, 02:51
  5. DARK - a new BWT-based command-line archiver
    By encode in forum Forum Archive
    Replies: 138
    Last Post: 23rd September 2006, 21:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •