TTS (Text to speech)で遊ぶ。
入力したテキストを音声で読み上げ、もしくはaiffファイルに保存するAppleScript。
property dText : ""
on idle
display dialog "Please enter something." default answer dText buttons {"QUIT", "SAVE", "TEST"} default button 3
set dResult to result
button returned of dResult
set spText to text returned of dResult
if button returned of dResult is "QUIT" then
quit
else
if spText is not "" then
set dText to spText
-- [[rate 180]]で読み上げスピードを設定する
set theText to "[[rate 180]]" & spText
if button returned of dResult is "TEST" then
-- Victoria の声で読み上げ
say theText using "Victoria"
else
set saveFile to ((path to desktop as string) & spText & ".aiff")
say theText using "Victoria"
say theText using "Victoria" saving to file saveFile
end if
end if
end if
return 1
end idle
上記のスクリプトをスクリプトエディタから保存して実行します。
(「初期画面を表示しない」「実行後も終了しない」にチェックをつける)
一応OS 10.3.9 では動作確認済み。
Victoria 以外の声のリスト
http://docs.info.apple.com/article.html?path=AppleScript/2.1/jp/as304.html
| 固定リンク | コメント (0) | トラックバック (0)






最近のコメント