diff options
author | XANTRONIX Development | 2022-02-01 22:12:56 -0500 |
---|---|---|
committer | XANTRONIX Development | 2022-02-01 22:13:35 -0500 |
commit | 325f2f18c93ede6f0de0efcc211fb856d0bfbcaa (patch) | |
tree | 3f3151cc552050fc73eb29a00a0acdf15ad4e42f /src | |
parent | e7746e3358b7dd8bb57e63aa67c020b598b723c6 (diff) | |
download | xas-325f2f18c93ede6f0de0efcc211fb856d0bfbcaa.tar.gz xas-325f2f18c93ede6f0de0efcc211fb856d0bfbcaa.tar.bz2 xas-325f2f18c93ede6f0de0efcc211fb856d0bfbcaa.zip |
Implement xas_vox_generate()
Implement xas_vox_generate() to finalise phrases sent to Festival
Diffstat (limited to 'src')
-rw-r--r-- | src/vox.c | 26 |
1 files changed, 11 insertions, 15 deletions
@@ -211,18 +211,9 @@ int xas_vox_stop(xas_vox *vox) { return vox_stop(vox); } -int xas_vox_vsayf(xas_vox *vox, const char *format, va_list args) { - int ret; +int xas_vox_generate(xas_vox *vox) { xas_audio_stream *output; - if (vox_start(vox) < 0) { - goto error_vox_start; - } - - if ((ret = vfprintf(vox->in, format, args)) < 0) { - goto error_vfprintf; - } - (void)fflush(vox->in); (void)fclose(vox->in); (void)close(vox->stdin); @@ -243,14 +234,19 @@ int xas_vox_vsayf(xas_vox *vox, const char *format, va_list args) { xas_audio_stream_destroy(output); - return ret; + return 0; error_invalid_stream: - xas_audio_stream_destroy(output); - error_riff_open_fd: -error_vfprintf: - (void)vox_stop(vox); + return -1; +} + +int xas_vox_vsayf(xas_vox *vox, const char *format, va_list args) { + if (vox_start(vox) < 0) { + goto error_vox_start; + } + + return vfprintf(vox->in, format, args); error_vox_start: return -1; |