diff options
author | Dima Zavin <dima@android.com> | 2011-04-05 16:03:45 -0700 |
---|---|---|
committer | Dima Zavin <dima@android.com> | 2011-04-19 23:12:04 -0700 |
commit | 7ed4bd69539d9408361c7c77726255902125416a (patch) | |
tree | 50a549a4f7cb45c7492366838b635e6364314039 /pico | |
parent | e246fccbaf595e39c647502fa76f996dee8f0711 (diff) | |
download | external_svox-7ed4bd69539d9408361c7c77726255902125416a.zip external_svox-7ed4bd69539d9408361c7c77726255902125416a.tar.gz external_svox-7ed4bd69539d9408361c7c77726255902125416a.tar.bz2 |
svox: convert to use new audio.h
Change-Id: Id8e69601a0812a6a0034774adde672bb70662c6a
Signed-off-by: Dima Zavin <dima@android.com>
Diffstat (limited to 'pico')
-rw-r--r-- | pico/compat/include/TtsEngine.h | 2 | ||||
-rw-r--r-- | 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 <TtsEngine.h> #include <cutils/jstring.h> +#include <hardware/audio.h> #include <picoapi.h> #include <picodefs.h> @@ -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) { |