On 11-10-25 12:47 PM, Anand Mishra wrote:
Can anyone please help me in making a beep sound from a c program in
gcc ?
I m unable to do so even by using a "beep program"
I m working under Ubuntu 10.x
I googled for "linux c system bell" and found several relevant hits. I
am attaching the link to the first hit which has some C code. You might
want to make sure that in volume settings, system bell is not muted.
http://mark.koli.ch/2008/11/howto-make-your-linux-system-beep.html
The above requires you to be root.
As an alternate, you might want to look at playing an audio file or
generate one on the fly. References that might be useful for this are
[1,2,3]. The code at [1] is something that I have used before for a
project but I can't remember where I found it the first time.
HTH,
Sharad
[1] http://www.groupsrv.com/linux/post-915846.html
[2] http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html
[3] http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html
--
Mailing list guidelines and other related articles: http://lug-iitd.org/Footer