Module: sems
Branch: master
Commit: afc1903038783ad00736f3f1601bb59bc7de3195
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=afc1903038783ad00736f3f1601bb59bc7de3195

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Fri Jul 22 15:20:50 2011 +0200

b/f: py_sems with flite TTS

---

 apps/py_sems/PySems.h        |    4 ----
 apps/py_sems/PySemsAudio.cpp |   15 ++++++++-------
 apps/py_sems/PySemsAudio.h   |    4 ++--
 3 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/apps/py_sems/PySems.h b/apps/py_sems/PySems.h
index 7043b4c..8e5c3ed 100644
--- a/apps/py_sems/PySems.h
+++ b/apps/py_sems/PySems.h
@@ -28,10 +28,6 @@
 #include "AmB2BSession.h"
 #include "AmPlaylist.h"
 
-#ifdef PY_SEMS_WITH_TTS
-#include "flite.h"
-#endif
-
 #include <string>
 #include <map>
 using std::string;
diff --git a/apps/py_sems/PySemsAudio.cpp b/apps/py_sems/PySemsAudio.cpp
index dfa3962..bfcbefc 100644
--- a/apps/py_sems/PySemsAudio.cpp
+++ b/apps/py_sems/PySemsAudio.cpp
@@ -4,12 +4,13 @@
 
 #include "log.h"
 
-#ifdef IVR_WITH_TTS
+#ifdef PY_SEMS_WITH_TTS
+#  include "flite.h"
+#  define TTS_CACHE_PATH "/tmp/"
 
-#define TTS_CACHE_PATH "/tmp/"
 extern "C" cst_voice *register_cmu_us_kal();
 
-#endif //ivr_with_tts
+#endif //PY_SEMS_WITH_TTS
 
 
 static PyObject* PySemsAudioFile_new(PyTypeObject *type, PyObject *args, 
PyObject *kwds)
@@ -27,7 +28,7 @@ static PyObject* PySemsAudioFile_new(PyTypeObject *type, 
PyObject *args, PyObjec
       return NULL;
     }
 
-#ifdef IVR_WITH_TTS
+#ifdef PY_SEMS_WITH_TTS
     flite_init();
     self->tts_voice = register_cmu_us_kal();
     self->filename = new string();
@@ -44,7 +45,7 @@ static void PySemsAudioFile_dealloc(PySemsAudioFile* self)
   delete self->af;
   self->af = NULL;
 
-#ifdef IVR_WITH_TTS
+#ifdef PY_SEMS_WITH_TTS
   if(self->del_file && !self->filename->empty())
     unlink(self->filename->c_str());
   delete self->filename;
@@ -140,7 +141,7 @@ static PyObject* PySemsAudioFile_rewind(PySemsAudioFile* 
self, PyObject* args)
   return Py_None;
 }
 
-#ifdef IVR_WITH_TTS
+#ifdef PY_SEMS_WITH_TTS
 static PyObject* PySemsAudioFile_tts(PyObject* cls, PyObject* args)
 {
   char* text;
@@ -231,7 +232,7 @@ static PyMethodDef PySemsAudioFile_methods[] = {
    "creates a new Python file with the actual file"
    " and eventually flushes headers (audio->on_stop)"
   },
-#ifdef IVR_WITH_TTS
+#ifdef PY_SEMS_WITH_TTS
   {"tts", (PyCFunction)PySemsAudioFile_tts, METH_CLASS | METH_VARARGS,
    "text to speech"
   },
diff --git a/apps/py_sems/PySemsAudio.h b/apps/py_sems/PySemsAudio.h
index e1a1b4b..a5325e3 100644
--- a/apps/py_sems/PySemsAudio.h
+++ b/apps/py_sems/PySemsAudio.h
@@ -10,7 +10,7 @@
 #define AUDIO_READ  1
 #define AUDIO_WRITE 2
 
-#ifdef IVR_WITH_TTS
+#ifdef PY_SEMS_WITH_TTS
 #include "flite.h"
 #endif
 
@@ -20,7 +20,7 @@ typedef struct {
   PyObject_HEAD
   AmAudioFile* af;
 
-#ifdef IVR_WITH_TTS
+#ifdef PY_SEMS_WITH_TTS
   cst_voice* tts_voice;
   string*    filename;
   bool       del_file;

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to