pinterest
V2EX  ›  macOS

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

  •  
  •   pinterest · Aug 27, 2016 · 3474 views
    This topic created in 3572 days ago, the information mentioned may be changed or developed.

    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 replies    2016-08-28 16:59:01 +08:00
    pinterest
        1
    pinterest  
    OP
       Aug 27, 2016
    `display notification "test" sound name "Ding_dong.aiff"`
    也是有声音的
    thekoc
        2
    thekoc  
       Aug 28, 2016
    ~/Library/Sounds/ 和 /System/Library/Sounds/ 文件夹下面没有 ding_dong.aiff 这个文件,运行 display notification "test" sound name "ding_dong.aiff" 会发出声音,估计是 fallback 到缺省值了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1276 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 17:19 · PVG 01:19 · LAX 10:19 · JFK 13:19
    ♥ Do have faith in what you're doing.