Stdin and Stdout options -- is this broken?

Voices aren't working properly?

Stdin and Stdout options -- is this broken?

Postby liamk » Wed Oct 22, 2008 1:46 pm

Hi --

I was expecting this to work:
echo 'This is some text' | /opt/swift/bin/swift -f - -m text -p audio/output-format=raw,audio/encoding=pcm16 -o tmp.wav

But it fails silently.

Really what I want is more like:
echo 'This is some text' | /opt/swift/bin/swift -f - -m text -p audio/output-format=raw,audio/encoding=pcm16 -o -

... because I want to use it as part of a pipe.

However, even the first example fails.

What's going on with swift's streams?

Liam
liamk
 
Posts: 1
Joined: Wed Oct 22, 2008 1:40 pm

It's a quirk in the command line

Postby AdamW » Mon Oct 27, 2008 1:10 pm

Hi,
Swift has a documented quirk when handling standard input. Typing swift at the command line yields:
-f <list> Synthesize text files or play audio in <list>. To use standard input, use "-f -". Multiple file names may be given. Without the "-f" switch, the default is to synthesize text arguments on the command line. When taking input from a pipe, the engine will always treat two newlines as an input delimeter, and start speaking text up to that point without waiting for the end of the file.


Therefore the following should work:

echo -e "blue blah\n\n" | swift -f -
AdamW
 


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 11 guests

cron