diff --git a/apps/py_sems/PySems.h b/apps/py_sems/PySems.h index 7043b4cc..8e5c3ed4 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 #include using std::string; diff --git a/apps/py_sems/PySemsAudio.cpp b/apps/py_sems/PySemsAudio.cpp index dfa39628..bfcbefcf 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 e1a1b4bc..a5325e3f 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;