Warning: main() [function.main]: open_basedir restriction in effect. File(/var/data/www/ods/ods.com.ua/htdocs/htdig/header.php) is not within the allowed path(s): (/home/ods/:/tmp:/usr/local/lib/php/) in /home/ods/domains/ods.com.ua/public_html/win/eng/unix/lpg/node83.html on line 4
Warning: main(/var/data/www/ods/ods.com.ua/htdocs/htdig/header.php) [function.main]: failed to open stream: Operation not permitted in /home/ods/domains/ods.com.ua/public_html/win/eng/unix/lpg/node83.html on line 4
Warning: main() [function.include]: Failed opening '/var/data/www/ods/ods.com.ua/htdocs/htdig/header.php' for inclusion (include_path='.:/usr/local/lib/php/') in /home/ods/domains/ods.com.ua/public_html/win/eng/unix/lpg/node83.html on line 4
next up previous contents
Next: 7.2 Programming a sound
Up: 7 Sound Programming
Previous: 7 Sound Programming
Believe it or not, your PC speaker is part of the Linux console and
thus a character device. Therefore, ioctl() requests exist to manipulate
it. For the internal speaker the following 2 requests exist:
- KDMKTONE
Generates a beep for a specified time using the kernel timer.
Example: ioctl (fd, KDMKTONE,(long) argument).
- KIOCSOUND
Generates an endless beep or stops a currently sounding beep.
Example: ioctl(fd,KIOCSOUND,(int) tone).
The argument consists of the tone value in the low word and
the duration in the high word. The tone value is not the
frequency. The PC mainboard timer 8254 is clocked at 1.19 MHz and so
it's 1190000/frequency. The duration is measured in timer ticks. Both
ioctl calls return immediately so you can this way produce beeps
without blocking the program.
KDMKTONE should be used for warning signals because you don't have
to worry about stopping the tone.
KIOCSOUND can be used to play melodies as demonstrated in the example
program splay (please send more .sng files to me). To stop the
beep you have to use the tone value 0.
Converted on:
Fri Mar 29 14:43:04 EST 1996
Warning: main() [function.main]: open_basedir restriction in effect. File(/var/data/www/ods/ods.com.ua/htdocs/include/footer.php) is not within the allowed path(s): (/home/ods/:/tmp:/usr/local/lib/php/) in /home/ods/domains/ods.com.ua/public_html/win/eng/unix/lpg/node83.html on line 48
Warning: main(/var/data/www/ods/ods.com.ua/htdocs/include/footer.php) [function.main]: failed to open stream: Operation not permitted in /home/ods/domains/ods.com.ua/public_html/win/eng/unix/lpg/node83.html on line 48
Warning: main() [function.include]: Failed opening '/var/data/www/ods/ods.com.ua/htdocs/include/footer.php' for inclusion (include_path='.:/usr/local/lib/php/') in /home/ods/domains/ods.com.ua/public_html/win/eng/unix/lpg/node83.html on line 48