用 afplay 试听 macOS 系统提示音
在终端或脚本里播放系统自带的提示音(Ping、Funk、Glass……)。
运行 afplay /System/Library/Sounds/Funk.aiff 试听提示音;用 ls /System/Library/Sounds 查看全部音效。
01命令
命令
$ afplay /System/Library/Sounds/Funk.aiff02作用说明
macOS 的提示音以 AIFF 文件存放在 /System/Library/Sounds 目录,用 afplay 可以立刻播放。既适合在系统设置里挑选提示音前先试听,也更适合写进脚本——比如长时间构建或备份结束时播放一声提示。经典音效一应俱全:Basso、Blow、Bottle、Frog、Funk、Glass、Hero、Morse、Ping、Pop、Purr、Sosumi、Submarine、Tink。
03风险
!注意: afplay 会等到声音播完才返回;在脚本里想让它在后台播放可在末尾加 &。音量跟随系统输出音量,不能用参数单独调节。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- afplay - audio file play依据: Documents afplay for playing audio files, including AIFF system sounds, from the command line.
最后验证: 2026-09-18 · 分类: 媒体