V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
pinterest
V2EX  ›  macOS

发现一件很魔性的事情,“ding_dong”的文件名有什么特殊的地方吗?

  •  
  •   pinterest · 2016-08-27 23:37:44 +08:00 · 2603 次点击
    这是一个创建于 2769 天前的主题,其中的信息可能已经有所发展或是发生改变。

    AppleScript 代码:
    display notification "test" sound name "ding_dong.aiff

    可以播放 ~/Library/Sounds/ 下的对应的音频文件

    只要文件名为“ ding_dong ”,结果就是静音的
    而文件名为“ ding_don ”、“ ing_dong ”、“ ding_dong1 ”、“ 1ding_dong ”、“ ding_1dong ”、“ dingdong ”
    都是有声音的!!!

    另外,系统的Sounds目录的文件都是默认的,所以不会影响
    不知道各位V2EXer能不能试验出同样的效果

    2 条回复    2016-08-28 16:59:01 +08:00
    pinterest
        1
    pinterest  
    OP
       2016-08-27 23:51:51 +08:00
    `display notification "test" sound name "Ding_dong.aiff"`
    也是有声音的
    thekoc
        2
    thekoc  
       2016-08-28 16:59:01 +08:00
    ~/Library/Sounds/ 和 /System/Library/Sounds/ 文件夹下面没有 ding_dong.aiff 这个文件,运行 display notification "test" sound name "ding_dong.aiff" 会发出声音,估计是 fallback 到缺省值了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3330 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:35 · PVG 21:35 · LAX 06:35 · JFK 09:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.