MacOS OSX 如何在终端或使用键盘快捷键将文本更改为语音?
MacOS OSX How to change the text to speech voice in terminal or with a keyboard shortcut?
我正在寻找一种使用快捷方式更改声音的方法:
进入设置->辅助功能->语音并设置语音 "Alex"
需要很长时间。
有人知道终端命令吗?或者使用键盘快捷键更改它的方法?
我用英语和荷兰语讲话,所以我必须每天手动更改几次语音。谢谢
看看https://github.com/mklement0/voices。语音是用于更改默认文本到语音语音的命令行工具。但该工具的作者警告说:
As of macOS 10.12 (Sierra), there is no documented programmatic way to
change the default voice. Thus, this utility makes use of undocumented
system internals, which, unfortunately, means that future
compatibility of this feature is uncertain.
但目前,它似乎适用于最新的 Sierra 版本。
此外,作者还提供了替代品的链接,例如:
If you have Alfred with its Power Pack, consider workflow speak.awf as a superior alternative.
感谢@cello 的提示:https://github.com/mklement0/voices
我创建了一个小的 appleScript 来改变声音
on run {}
set changeVoiceToo to ""
set currentVoice to do shell script "export PATH=/usr/local/bin:$PATH;" & "voices -b"
if currentVoice is "Alex" then
set changeVoiceToo to "Xander"
else
set changeVoiceToo to "Alex"
end if
do shell script "export PATH=/usr/local/bin:$PATH; voices -d " & changeVoiceToo
do shell script "export PATH=/usr/local/bin:$PATH; say " & changeVoiceToo
# display notification currentVoice sound name "Tink"
display notification "Voice Change!" with title changeVoiceToo # sound name "Tink"
end run
我希望这对某人有用
我正在寻找一种使用快捷方式更改声音的方法: 进入设置->辅助功能->语音并设置语音 "Alex" 需要很长时间。
有人知道终端命令吗?或者使用键盘快捷键更改它的方法?
我用英语和荷兰语讲话,所以我必须每天手动更改几次语音。谢谢
看看https://github.com/mklement0/voices。语音是用于更改默认文本到语音语音的命令行工具。但该工具的作者警告说:
As of macOS 10.12 (Sierra), there is no documented programmatic way to change the default voice. Thus, this utility makes use of undocumented system internals, which, unfortunately, means that future compatibility of this feature is uncertain.
但目前,它似乎适用于最新的 Sierra 版本。
此外,作者还提供了替代品的链接,例如:
If you have Alfred with its Power Pack, consider workflow speak.awf as a superior alternative.
感谢@cello 的提示:https://github.com/mklement0/voices
我创建了一个小的 appleScript 来改变声音
on run {}
set changeVoiceToo to ""
set currentVoice to do shell script "export PATH=/usr/local/bin:$PATH;" & "voices -b"
if currentVoice is "Alex" then
set changeVoiceToo to "Xander"
else
set changeVoiceToo to "Alex"
end if
do shell script "export PATH=/usr/local/bin:$PATH; voices -d " & changeVoiceToo
do shell script "export PATH=/usr/local/bin:$PATH; say " & changeVoiceToo
# display notification currentVoice sound name "Tink"
display notification "Voice Change!" with title changeVoiceToo # sound name "Tink"
end run
我希望这对某人有用