summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/flitedyn.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/flitedyn.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/flitedyn.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/flitedyn.cpp b/noncore/apps/opie-reader/flitedyn.cpp
new file mode 100644
index 0000000..c268cd4
--- a/dev/null
+++ b/noncore/apps/opie-reader/flitedyn.cpp
@@ -0,0 +1,29 @@
+#include "flitedyn.h"
+
+cst_voice *CFliteDyn::m_voice = NULL;
+
+CFliteDyn::CFliteDyn()
+{
+ if (m_voice == NULL)
+ {
+ qDebug("Constucting flite");
+ flite_init();
+ m_voice = register_cmu_us_kal();
+ }
+}
+
+QString CFliteDyn::about()
+{
+ return QString("FliteDyn output codec (c) Tim Wentford\n");
+}
+
+void CFliteDyn::output(const QString& _o)
+{
+ float tm = flite_text_to_speech((const char*)_o, m_voice, "play");
+ qDebug("Produced %g seconds of speech", tm);
+}
+
+extern "C"
+{
+ COutput* newcodec() { return new CFliteDyn; }
+}