Ok pretty simple: How to make internal speaker beep on Linux. For personal use does not need to be portable. I know I have an internal speaker... BIOS loves that thing...

6 Years
Discussion Span
Last Post by Zssffssz

On most distros you should be able to just use the "alarm" character (0x07, or "\a" as an escaped sequence). In other words, this should work:

#include <iostream>

int main() {
  std::cout << "\a";
  return 0;

If not, you can use the "beep" program (install it with "sudo apt-get install beep", and check the manual).

But, before you try too many things, verify that you have a PC Speaker and that it is enabled, use the command amixer scontents and you should see an entry called "PC Speaker" and its playback should be enabled (i.e. Linux distros often disable the PC speaker after startup).


Why do they disable the internal speaker? It seems as if my copy of Kubuntu is very louse about restrictions... It even let's me use Linix's experimental NTFS editor:-)
Edit: I don't have internet SUDO apt-get is outside of my ability (this is why I'm considering solaris)

Edited by Zssffssz: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.