[quoted lines by r00t the LiNuXeRRR on April 20, 2000, at 10:59]

>       Does exist a sound(); function like the one from Borland C from
>dos that turns on the speaker at a given frequance... The sound();
>function doesn't work in linux...

Yes. You do it through ioctl. Open a file descriptor to the console:

    int fd = open("/dev/tty0", O_WRONLY);

Start the tone by:

    ioctl(fd, KIOCSOUND, (1190000 / herz));

Stop the tone by:

    ioctl(fd, KIOCSOUND, 0);

For O_WRONLY, you'll need:

    #include <fcntl.h>

For KIOCSOUND, you'll need:

    #include <linux/kd.h>

-- 
Dave Mielke           | 856 Grenon Avenue | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario   | Word of God. Please contact me
EMail: [EMAIL PROTECTED] | Canada  K2B 6G3   | if you're concerned about Hell.

Reply via email to