Browse Source

espeakengine: correctly implement TtsEngine::setAudioFormat.

master
Reece H. Dunn 12 years ago
parent
commit
f45a01b8e0
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      android/jni/jni/espeakengine.cpp

+ 5
- 2
android/jni/jni/espeakengine.cpp View File

char currentCountry[10]; char currentCountry[10];
char currentVariant[10]; char currentVariant[10];


int sampleRate = 0;
bool hasInitialized = false; bool hasInitialized = false;


/* Functions internal to the eSpeak engine wrapper */ /* Functions internal to the eSpeak engine wrapper */


// TODO Make sure that the speech data is loaded in // TODO Make sure that the speech data is loaded in
// the directory /sdcard/espeak-data before calling this. // the directory /sdcard/espeak-data before calling this.
int sampleRate = espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, 4096, eSpeakDataPath, 0);
sampleRate = espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, 4096, eSpeakDataPath, 0);


if (sampleRate <= 0) { if (sampleRate <= 0) {
LOGE("eSpeak initialization failed!"); LOGE("eSpeak initialization failed!");
tts_result TtsEngine::setAudioFormat(tts_audio_format& encoding, uint32_t& rate, int& channels) { tts_result TtsEngine::setAudioFormat(tts_audio_format& encoding, uint32_t& rate, int& channels) {
LOGE("setAudioFormat(%d, %d, %d) is unsupported", encoding, rate, channels); LOGE("setAudioFormat(%d, %d, %d) is unsupported", encoding, rate, channels);


// TODO: Fix this!
encoding = TTS_AUDIO_FORMAT_PCM_16_BIT;
rate = sampleRate;
channels = 1;
return TTS_SUCCESS; return TTS_SUCCESS;
} }



Loading…
Cancel
Save