Windows Beep() equivalent for Linux

前端 未结 6 783
我在风中等你
我在风中等你 2021-02-09 12:38

I am experimenting with Beep function on Windows:

#include 
...
Beep(frequency, duration);

The computer then beeps with some f

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-09 13:14

    In summary:

    1. Outputting a BEL character to a terminal might produce a beep - depending on what terminal it is and what its configuration is. There is no control over this however.

    2. Any sound you like can be produced by outputting audio data to /dev/dsp or some other sound device. This includes beep, but making a sound involves playing back an actual sample.

    3. The console driver provides (in some configurations) an ioctl for /dev/console which beeps with a configurable pitch (much like the NT one)

提交回复
热议问题