9
3
How to emit sound using built-in speaker from a command line in Windows and Linux?
9
3
How to emit sound using built-in speaker from a command line in Windows and Linux?
10
You can call the Win32 MessageBeep operating system function.
On Windows XP or later, type:
rundll32 user32.dll,MessageBeep
I tried it years ago and at first I didn't believe it would work. But that's Microsoft suggested way, as according to their MSDN website:
"...MessageBeep attempts to play the system default sound. If it cannot play the system default sound, the function produces a standard beep sound through the computer speaker."
4
On *nix operating systems beep used to do it.
SYNOPSIS
beep [ -v ] [ -X | -T | -S ]
DESCRIPTION
beep is a command-line utility for making a computer go beep.
Under normal circumstances, you should be able to use it just by typing ‘beep’, with no options.
What operating systems were these? – Richard Hoskins – 2009-07-24T16:58:06.287
You can install this from most debian based linux repositories with sudo apt-get install beep – Charles Ma – 2009-07-25T05:04:26.117
required modprobe pcspkr
too, http://askubuntu.com/questions/19906/beep-in-shell-script-not-working
2
With bash on Unix:
echo $'\007'
1
Echo ^g
where ^ is the ctrl key. Note this doesn't work on Windows 7 - The beep is redirected to the audio system.
hey, it works on Windows 7!!!! I think for some motherboards that does not have internal speaker or that it is disabled on sound properties it will not beep. but I tested and functioned!!! but use CTRL instead of "^" character. I don't know the difference, but... – kokbira – 2011-05-10T20:08:52.573
4What operating system? – arathorn – 2009-07-24T16:08:54.500