From 7ed4bd69539d9408361c7c77726255902125416a Mon Sep 17 00:00:00 2001 From: Dima Zavin Date: Tue, 5 Apr 2011 16:03:45 -0700 Subject: svox: convert to use new audio.h Change-Id: Id8e69601a0812a6a0034774adde672bb70662c6a Signed-off-by: Dima Zavin --- pico/compat/include/TtsEngine.h | 2 +- pico/tts/com_svox_picottsengine.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pico/compat/include/TtsEngine.h b/pico/compat/include/TtsEngine.h index 998e353..916118c 100644 --- a/pico/compat/include/TtsEngine.h +++ b/pico/compat/include/TtsEngine.h @@ -159,7 +159,7 @@ public: // @param[inout] channels in: the desired number of audio channels // out: the number of channels used by the TTS engine // @return TTS_SUCCESS, or TTS_FAILURE - virtual tts_result setAudioFormat(AudioSystem::audio_format& encoding, uint32_t& rate, + virtual tts_result setAudioFormat(audio_format_t& encoding, uint32_t& rate, int& channels); // Set a property for the the TTS engine diff --git a/pico/tts/com_svox_picottsengine.cpp b/pico/tts/com_svox_picottsengine.cpp index 6c05d00..fd40cee 100644 --- a/pico/tts/com_svox_picottsengine.cpp +++ b/pico/tts/com_svox_picottsengine.cpp @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -1290,11 +1291,11 @@ tts_result TtsEngine::getLanguage(char *language, char *country, char *variant) * @channels - reference to number of channels * return tts_result * */ -tts_result TtsEngine::setAudioFormat(AudioSystem::audio_format& encoding, uint32_t& rate, +tts_result TtsEngine::setAudioFormat(audio_format_t& encoding, uint32_t& rate, int& channels) { // ignore the input parameters, the enforced audio parameters are fixed here - encoding = AudioSystem::PCM_16_BIT; + encoding = AUDIO_FORMAT_PCM_16_BIT; rate = 16000; channels = 1; return TTS_SUCCESS; @@ -1585,7 +1586,7 @@ tts_result TtsEngine::synthesizeText( const char * text, int8_t * buffer, size_t bufused += bytes_recv; } else { /* The buffer filled; pass this on to the callback function. */ - cbret = picoSynthDoneCBPtr(userdata, 16000, AudioSystem::PCM_16_BIT, 1, buffer, + cbret = picoSynthDoneCBPtr(userdata, 16000, AUDIO_FORMAT_PCM_16_BIT, 1, buffer, bufused, TTS_SYNTH_PENDING); if (cbret == TTS_CALLBACK_HALT) { LOGI("Halt requested by caller. Halting."); @@ -1603,7 +1604,7 @@ tts_result TtsEngine::synthesizeText( const char * text, int8_t * buffer, size_t /* This chunk of synthesis is finished; pass the remaining samples. Use 16 KHz, 16-bit samples. */ if (!picoSynthAbort) { - picoSynthDoneCBPtr( userdata, 16000, AudioSystem::PCM_16_BIT, 1, buffer, bufused, + picoSynthDoneCBPtr( userdata, 16000, AUDIO_FORMAT_PCM_16_BIT, 1, buffer, bufused, TTS_SYNTH_PENDING); } picoSynthAbort = 0; @@ -1616,7 +1617,7 @@ tts_result TtsEngine::synthesizeText( const char * text, int8_t * buffer, size_t free(local_text); } LOGV("Synth loop: sending TTS_SYNTH_DONE after error"); - picoSynthDoneCBPtr( userdata, 16000, AudioSystem::PCM_16_BIT, 1, buffer, bufused, + picoSynthDoneCBPtr( userdata, 16000, AUDIO_FORMAT_PCM_16_BIT, 1, buffer, bufused, TTS_SYNTH_DONE); pico_resetEngine( picoEngine, PICO_RESET_SOFT ); return TTS_FAILURE; @@ -1625,7 +1626,7 @@ tts_result TtsEngine::synthesizeText( const char * text, int8_t * buffer, size_t /* Synthesis is done; notify the caller */ LOGV("Synth loop: sending TTS_SYNTH_DONE after all done, or was asked to stop"); - picoSynthDoneCBPtr( userdata, 16000, AudioSystem::PCM_16_BIT, 1, buffer, bufused, + picoSynthDoneCBPtr( userdata, 16000, AUDIO_FORMAT_PCM_16_BIT, 1, buffer, bufused, TTS_SYNTH_DONE); if (local_text) { -- cgit v1.1