author | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
---|---|---|
committer | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
commit | 39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91 (patch) (side-by-side diff) | |
tree | 96e66fdc18dca4d4ab8611133e072f57dea224b9 /noncore/apps/opie-reader/flitecmd.cpp | |
parent | 279fc4fd1986074acbadd3a8e86fcf3968a8dd5c (diff) | |
download | opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.zip opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.gz opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.bz2 |
new opie-reader sources with support for ArriereGo, Reb input and flite output plugins
Diffstat (limited to 'noncore/apps/opie-reader/flitecmd.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/flitecmd.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/flitecmd.cpp b/noncore/apps/opie-reader/flitecmd.cpp new file mode 100644 index 0000000..bb7e303 --- a/dev/null +++ b/noncore/apps/opie-reader/flitecmd.cpp @@ -0,0 +1,43 @@ +#include <unistd.h> +#include <sys/types.h> +#include <sys/wait.h> +#include <errno.h> +#include "flitecmd.h" + +void CFliteCmd::output(const QString& txt) +{ + pid_t pid; + if ((pid = fork()) <0) + { + qDebug("No memory"); + } + else if (pid == 0) + { + execlp("flite", "flite", "-t", (const char*)txt, NULL); + _exit(127); + qDebug("Can't find flite"); + } + else + { + int status; + while (waitpid(pid, &status, 0) < 0) + { + if (errno != EINTR) + { + qDebug("Error from flite"); + break; + } + } + qDebug("flite status:%d", status); + } +} + +QString CFliteCmd::about() +{ + return QString("FliteCmd output codec (c) Tim Wentford\n"); +} + +extern "C" +{ + COutput* newcodec() { return new CFliteCmd; } +} |