2015-09-07 134 views
3

X11中是否有一個函數,或者內置於Linux中可以產生不同頻率的Beep聲音?不同頻率的聲音

一些函數,如Windows中的Beep(dwFreq, dwDuration)函數,該函數的參數允許指定以赫茲爲單位的頻率和以毫秒爲單位的持續時間。

+1

您可能要開始[xbell(3) - Linux手冊頁(http://linux.die.net/man/ 3/xbell)然後看[xdevicebell(3) - Linux man page](http://linux.die.net/man/3/xdevicebell)然後看看[xchangefeedbackcontrol(3) - Linux man page](http: //linux.die.net/man/3/xchangefeedbackcontrol)但是它可能有點複雜。另請參閱http://stackoverflow.com/questions/10072909/beep-on-linux-in-c –

+0

這實際上是一個很好的問題,我也會對一個答案感興趣。 –

回答

1

試用揚聲器測試(1)。 它通常可以在alsa-utils包中找到。

例如(產生正弦波,440赫茲):

speaker-test -f 440 -t sine 
+0

我該如何調整時間? – user2029077

+0

檢查'man speaker-test'。也許你可以找到一個有用的選項。 –

+0

我測試過選項,但總是會產生10秒的嗶聲。 – user2029077