让MAC系统为你唱中英文生日快乐歌

在AppleScript中,输入:


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}
-- 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}
-- 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}
set syllables to {"Zoo", "ni", "sen", "ri", "Kai", "Lar", "[[slnc 500]]", "hare", "pee", "birth", "day", "to", "you", "[[slnc 500]]", "hare", "pee", "birth", "day", "dear", firstName, lastName, "[[slnc 500]]", "hare", "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


 

然后,打开音响,点击播放,慢慢欣赏吧 吐舌头

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值