Is there a way to play a system beep on Mac OS using C++ and Xcode? I understand that I need to use a library. Is there a library that works across both the Mac and Windows
I think you probably want to use NSBeep.
NSBeep
Plays the system beep.
#include
void NSBeep (void);
This seems to work OK for a command line tool:
#include
#include
using namespace std;
int main(void)
{
cout << "Hello world !" << endl;
NSBeep ();
return 0;
}
$ g++ -Wall -framework AppKit beep.cpp -o beep
$ ./beep