Page 1 of 1

Stdin and Stdout options -- is this broken?

PostPosted: Wed Oct 22, 2008 1:46 pm
by liamk
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

It's a quirk in the command line

PostPosted: Mon Oct 27, 2008 1:10 pm
by AdamW
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 -