Beep on Linux in C

前端 未结 5 1950
耶瑟儿~
耶瑟儿~ 2020-11-29 09:30

I want to generate a beep sound with a specific frequency and length (for different sound signals) using the system beeper (and only the speakers if beeper is not available

5条回答
  •  半阙折子戏
    2020-11-29 10:07

    open("/dev/tty", O_RDONLY); instead /dev/console will work with sound OK for terminal consoles without requiring superuser privileges. But virtual consoles in X session will fail with sound then, even for superuser.

提交回复
热议问题