我只是希望Mac OS X 10.6能像开放suse和其他发行版一样发出硬件哔哔声。我尝试了以下方法

Terminal -> beep = -bash: beep:命令不存在

终端->说哔哔=声音说哔哔(不是硬件的哔哔但很棒;))

applescript -> beep =麦金塔铃声(我想要一个硬件beep!)

有人知道如何在bin/bash或applescript中使硬件发出哔哔声吗?


当前回答

确实,下面这段很有效果,也很有旋律:

say -v Bells "dong dong dong"

[更新]不幸的是bell不再包含在最新的OS x中。

say -v Victoria Do your homework!

使用以下方法探索声音:

say -v \?

其他回答

如果你安装了XCODE,你可以发出哔哔声。我还没有发现我可以让打印“\a”字符在C中工作。

有一种方法可以让声音在程序运行时工作,启动XCODE,在XCODE下拉菜单,首选项,行为,选中第一个框播放声音,从列表中选择或添加一个声音。

这是一种方法,但我认为只有在程序运行时才能做到。

打印\a并不总是为我工作(MBA, 10.7.4)。我用这个代替:

say "beep"

这将循环所有的声音(在约塞米蒂工作):

say -v '?' | awk '{print $1}' | while read voice; do printf "using $voice...\n"; say -v $voice "hello, this is me using the $voice voice"; sleep 1; done
printf "\a"

如果你看man printf,它会给你一个转义字符列表,包括\a:

\a      Write a <bell> character.

如果你需要什么,听起来就像“important”

你可以使用

tput bel && sleep 0.33s && tput bel && sleep 0.33s && tput bel && sleep 0.33s && tput bel && sleep 0.33s && tput bel && sleep 0.33s && tput bel && sleep 0.33s && tput bel && sleep 0.33s && tput bel && sleep 0.33s && tput bel && sleep 0.33s && tput bel && sleep 0.33s

:)