4

I'm on another person's Mac-book Pro and I'm trying to output the alarm sound in C++ by outputting "\a" with cout. For some reason it's not making any sound when it outputs. Does anyone know why this could be happening? I'm using Eclipse.

Kalana
  • 5,631
  • 7
  • 30
  • 51
Nick Van Hoogenstyn
  • 1,287
  • 2
  • 13
  • 18
  • `std::cout << '\a' << std::endl;` works fine for my Macbook Pro under Windows 7. – Peter K. Jul 17 '11 at 23:45
  • Did you check what they might've set their beep sound to? On my MacBook Pro it's a sonar ping. They might've set it to be silent. – Chris Lutz Jul 17 '11 at 23:46
  • In some systems it just won't work. For example my old desktop PC used to run a program (that I wrote myself) that beeps perfectly, and my current laptop just won't make any sounds. I've searched for it, and found nothing. No settings in windows, no settings in the BIOS or anything. (and YES, volume is on :)) But it would be a nice idea to look into BIOS settings or audio driver settings, if there is. That may help. – Can Poyrazoğlu Jul 17 '11 at 23:50

1 Answers1

8

Eclipse's shell likely isn't wired up to interpret the classic BELL character correctly.

I can confirm that the bell does operate on Terminal.app however.

Note that the bell character is not part of C++ - it is purely a side effect of the console/terminal in use.

Yann Ramin
  • 32,895
  • 3
  • 59
  • 82