自從 iPhone 中的 Siri 變聰明無聊時都會招喚她出來聊聊天,無論是講笑話、繞口令、找餐廳,對 Siri 來說完全不是問題,跟 Siri 玩完那來聽看看 Mac 唱歌吧!
每當遇到生日總是要約些朋友出門大肆慶祝一番,無論聚餐、小酌最後都會聽到生日快樂歌,當回到家後還會自己默默回味一下,這時突然想再聽一次生日快樂歌,恩⋯⋯自己唱嗎?感覺也太心酸,叫 Mac 唱給你聽吧!
Mac 唱生日快樂歌給你聽
▲打開「工序指令編寫程式」。
▲開個新的指令編寫區並貼上下列指令。
生日快樂歌唱指令:
set currentUser to long user name of (get system info)
set firstName to (可以自行輸入英文名字)first word of currentUser
set lastName to(可以自行輸入英文名字)last word of currentUser
set noteValues to {56, 56, 58, 56, 61, 60, 50, 56, 56, 58, 56, 63, 61, 50, 56, 56, 68, 65, 61, 60, 58, 50, 66, 66, 65, 61, 63, 61} – F
– set noteValues to {65, 65, 67, 65, 70, 69, 60, 65, 65, 67, 65, 72, 70, 60, 65, 65, 77, 74, 70, 69, 67, 60, 75, 75, 74, 70, 72, 70} — D
– set noteValues to {55, 55, 57, 55, 60, 59, 50, 55, 55, 57, 55, 62, 60, 50, 55, 55, 67, 64, 60, 59, 57, 50, 65, 65, 64, 60, 62, 60} — E
set syllables to {“hap", “p", “birth", “day", “to", “you", “[[slnc 500]]", “hap", “p", “birth", “day", “to", “you", “[[slnc 500]]", “hap", “p", “birth", “day", “dear", firstName, lastName, “[[slnc 500]]", “hap", “p", “birth", “day", “to", “you"}
repeat with i from 1 to the length of noteValues
set thisValue to item i of noteValues
set thisSyllable to item i of syllables
if length of thisSyllable is less than 3 then
set speakingRate to 220
else
set speakingRate to 100
end if
say thisSyllable pitch thisValue using “Victoria" speaking rate speakingRate modulation 0
end repeat
▲點下「執行工序指令」就會聽到你的 Mac 在唱生日快樂歌囉!
雖然⋯⋯Mac 唱歌沒到天籟的程度,不過還是算滿有誠意的,無論是回到家想再聽一次生日快樂歌或是只能自己過生日,就讓 Mac 幫你唱生日快樂歌,覺得週一無聊苦悶想在辦公室聽聽解解悶也是個不錯的選擇。