1

I've noticed that whenever I'm in the command line and I try spd-say, it always stops shortly after it starts, and doesn't finish what I've told it to say.

For instance,

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!"

will only say moo moo farms are the best cow farms. They say moo, they don't pollute the earth, and they gi; and then it cuts off.

Can anyone tell me what is going on here? I'm using Linux Mint 19.0 on Aspire 5610Z and Linux Ubuntu 18.04 on Optiplex 755.

  • spd-say works in java, firefox (and probably Chrome's) speechSynthesis, and basically anywhere but the command line. – Joshua Miller Aug 14 at 0:37
  • Welcome to Ask Ubuntu. Linux Mint is off topic here. You can post this question at unix.stackexchange.com . Thank you. – Raffa Aug 14 at 0:45
  • 1
    It's not just linux mint I have this issue with; Linux Mint is the computer I use at home, and I use Linux Ubuntu at work, and the issue persists there. – Joshua Miller Aug 14 at 0:59
  • If this is the case, please edit your question and add the Ubuntu version you use removing any reference to off topic distributions. Thank you – Raffa Aug 14 at 1:04
3

The reason is spd-say times out and exits before completing the full text-to-speech output.

To make spd-say wait until the full text has been read, please add the option --wait after it. Like so:

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!"

Explanation - as requested by Joshua Miller:

spd-say sends text-to-speech output requests to speech-dispatcher. Please, read here.

However, if the text is too long, spd-say exits early... hence the need for the --wait option.

Other applications including your JAVA application might be sending text-to-speech output requests directly to speech-dispatcher. Please read the ( description ) part here.

  • 1
    Thanks! That worked. But, just wondering, why did it work fine in my java application? I didn't have the --wait parameter. – Joshua Miller Aug 14 at 1:22
  • 1
    @JoshuaMiller You are most welcome. spd-say sends text-to-speech output request to speech-dispatcher. Please read manpages.ubuntu.com/manpages/bionic/man1/spd-say.1.html , but it exits early if the text is too long ... hence the need for the --wait option. Your JAVA application might be sending text directly to speech-dispatcher. Please read the ( description ) part heremanpages.ubuntu.com/manpages/bionic/man1/… . – Raffa Aug 14 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.