#ifndef _XAS_VOX_H #define _XAS_VOX_H #include #include #include #include #include #define XAS_VOX_DEFAULT_GAIN 1.0f #define XAS_VOX_DEFAULT_BLKSIZE 20480 #define XAS_VOX_SETTINGS_TMP_PATH "/tmp/xas-vox.XXXXXX" #define XAS_VOX_SETTINGS_TMP_PATHLEN 64 enum xas_vox_state { XAS_VOX_IDLE, XAS_VOX_ACTIVE }; typedef struct _xas_vox { xas_object obj; xas_audio_format format; float gain; const char *text2wave_path; int argn; char **args; enum xas_vox_state state; int pid, stdin, stdout; char tmpfile[XAS_VOX_SETTINGS_TMP_PATHLEN]; int tmpfd; FILE *tmpfh; FILE *in; } xas_vox; xas_vox *xas_vox_new_args(xas_audio_format format, const char *text2wave_path, int argn, char **args); xas_vox *xas_vox_new(xas_audio_format format, const char *text2wave_path); void xas_vox_destroy(xas_vox *vox); void xas_vox_set_gain(xas_vox *vox, float gain); int xas_vox_set_voice(xas_vox *vox, const char *voice); int xas_vox_set_parameter(xas_vox *vox, const char *name, const char *value); int xas_vox_set_parameter_str(xas_vox *vox, const char *name, const char *value); int xas_vox_set_parameter_float(xas_vox *vox, const char *name, float value); int xas_vox_set_parameter_int(xas_vox *vox, const char *name, int value); int xas_vox_generate(xas_vox *vox); int xas_vox_stop(xas_vox *vox); int xas_vox_active(xas_vox *vox); int xas_vox_vsayf(xas_vox *vox, const char *message, va_list args); int xas_vox_sayf(xas_vox *vox, const char *message, ...); int xas_vox_say(xas_vox *vox, const char *message); xas_audio_stream *xas_vox_stream_new(xas_vox *vox); #endif /* _XAS_VOX_H */