为什么 spd-say 在命令行中过一会儿就停止说话?

Jos*_*ler 3 command-line text-to-speech

我注意到每当我在命令行中尝试 spd-say 时,它总是在启动后不久停止,并且没有完成我告诉它说的话。

例如,

spd-say "moo moo farms are the best cow farms ever. They say moo, they don't pollute the earth, and they give milk. Visit moo moo farms today for only twelve easy payments of seventeen ninety five weekly!"
Run Code Online (Sandbox Code Playgroud)

只会说moo moo farms are the best cow farms. They say moo, they don't pollute the earth, and they gi;然后它就切断了。

谁能告诉我这里发生了什么?我在 Aspire 5610Z 上使用 Linux Mint 19.0,在 Optiplex 755 上使用 Linux Ubuntu 18.04。

Raf*_*ffa 5

原因是 spd-say在完成完整的文本到语音输出之前超时并退出。

spd-say等到全文阅读完毕,请在--wait其后添加选项。像这样:

spd-say --wait "moo moo farms are the best cow farms ever. They say moo, they don't pollute the earth, and they give milk. Visit moo moo farms today for only twelve easy payments of seventeen ninety five weekly!"
Run Code Online (Sandbox Code Playgroud)

解释 - 根据约书亚米勒的要求:

spd-say将文本到语音输出请求发送到speech-dispatcher. 请在这里阅读。

但是,如果文本太长,则会spd-say提前退出……因此需要该--wait选项。

包括您的 JAVA 应用程序在内的其他应用程序可能会将文本转语音输出请求直接发送到speech-dispatcher. 请在此处阅读(说明)部分。

  • @JoshuaMiller 不客气。`spd-say` 将文本转语音输出请求发送到 `speech-dispatcher`。请阅读 https://manpages.ubuntu.com/manpages/bionic/man1/spd-say.1.html ,但如果文本太长它会提前退出......因此需要`--wait`选项. 您的 JAVA 应用程序可能会直接向“语音调度器”发送文本。请在此处阅读(说明)部分`https://manpages.ubuntu.com/manpages/bionic/man1/speech-dispatcher.1.html。 (2认同)