Beep on Linux in C

前端 未结 5 1951
耶瑟儿~
耶瑟儿~ 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:14

    I think the only way to do this is to either use suid to give my own program root access, or to use beep, which already has suid. I suppose I will just add one more dependency, then, as beep is not too big anyway.

    Thank you for all the answers, I'm sure other libraries are great for more complex signals, but I need a very simple one!

    I think this question can be marked as solved / closed, then.

    If anybody finds a way to create a beep using the console without superuser-privileges, I'm still interested in this solution :)

    Thank you all again.

提交回复
热议问题