This is my code in C.
#include <stdio.h>
int main(){
printf("\a\n");
printf("Startled by the sudden sound, Sally shouted, \"By the Great Pumpkin, what was that!?\"");
return 0;
}
Supposedly, "\a\n" is supposed to sound an alert right? For some reason, however, it's not doing so. I'm on Ubuntu Zesty, the bash command beep
does sound a beep, but echo -e '\a'
doesn't, so I'm not sure what the problem is exactly.
Made this question because other such questions didn't end up producing answers that were detailed/understandable enough to me, or had a different problem entirely whose solution didn't apply to me.
The post linked above, frankly, had an answer that was too vague. "The problem isn't with C, it's with something else." doesn't help at all.
UPDATE: Just incase someone else stumbles onto this, here was the problem:
I have GNOME, and the WM is Gnome-Shell as a result. Since that was the case, I had to open the sound settings, travel over to alerts, enable them, and make the volume higher. It never came to my attention that the shell itself could have been the problem. Realised this after running metacity --replace
and suddenly being able to hear alerts.