How do I make the 'beep' command work?
Solution 1
Does it have to be the system beep or can it be any sound?
You have a command on your system to play command line sounds. For instance open a terminal with Alt-F2 and
cd /usr/share/sounds/alsa/
aplay Front_Center.wav
will play this Front_Center.wav
.
So all you need is to find a beep.wav
on the web and use aplay
with it.
Solution 2
although over 2 years old i found using beep still to be an issue on my ubuntu 12.04 based system.
after making sure the beep mixer level is > 0 through alsamixer
the solution to a similar question at this askubuntu answer worked fine for me; it boils down to un-blacklisting the pcspkr
module in /etc/modprobe.d/blacklist.conf
. Or you can just do sudo modprobe pcspkr
for a temporary solution.
as described in the accepted answer a more pleasant audible notification could be achieved through playing some notification sounds present by default on most systems such as (for gnome based systems) e.g. paplay /usr/share/sounds/gnome/default/alerts/glass.ogg
note that paplay
(using pulse audio) might nowadays be the way to go instead of the alsa-based (but still working) aplay
.
Related videos on Youtube
fkeials
Updated on September 18, 2022Comments
-
fkeials over 1 year
I am trying to use the
beep
command, but it doesn't beep any sound.I installed it with
sudo apt-get install beep
, then I ranbeep
and nothing happen (no error displayed or sound played). I've also ransudo modprobe pcspkr
, andsudo alsamixer
, unmuted "beep" and put the db gain to 100. Andsudo alsactl store
after that.Is there a way to fix it or an alternative to
beep
?I am using Ubuntu 10.04.
-
Admin over 9 yearsNot a "real" solution but this is what I do: alias b='r -l "beepr" -e "beep(0)"', then use
b
.
-
-
fkeials almost 13 yearsYea i end up using aplay, dont know why beep is not working, thanks for your reply.
-
Cerin about 8 yearsThe point of
beep
is that it can generate any arbitrary beep. -
endolith over 7 years@Rinzwind and another downvote 5 years later, for not answering the question
-
endolith over 7 years"a more pleasant audible notification could be achieved" ... if your computer has a sound card and speakers.
-
Rinzwind over 7 years"or an alternative to beep?" hmmm?