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

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

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

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

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


当前回答

告诉应用程序“系统事件”哔哔声

其他回答

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

say "beep"

如果你需要什么,听起来就像“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

:)

在OS X终端下,执行命令:osascript -e 'beep'

使用OSA (Open Script Architecture)技术告诉AppleScript执行命令哔哔声。

printf "\a"

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

\a      Write a <bell> character.

macOS中没有“硬件哔哔声”。

The functionality you're thinking of is an artifact of very old (pre-1990s) IBM PC-compatible hardware. Before most computers had sound cards, most machines had a small speaker or piezo buzzer connected to one of the channels of a timer chip. This could be used to generate simple tones or beeps. Even after many computers integrated sound cards, it remained common for quite some time for computers to route this output to a separate internal speaker. More recently, many computers, especially laptops, have integrated this functionality into the onboard sound card.

(如果你对PC扬声器接口工作原理的技术细节感到好奇,这里有更多细节。)

这种硬件在苹果电脑中从未存在过。唯一可用的音频输出是通过声卡,macOS中唯一的系统哔哔声是用户的警报声。