Merge change 6407 into donut
* changes: Cleaning up logs. Initializing SpeechItem.mText to "" instead of null to prevent a null from accidentally being used when it is a non-text utterance.
This commit is contained in:
@@ -133,7 +133,7 @@ class SynthProxyJniStorage {
|
|||||||
delete mAudioOut;
|
delete mAudioOut;
|
||||||
mAudioOut = NULL;
|
mAudioOut = NULL;
|
||||||
} else {
|
} else {
|
||||||
LOGI("AudioTrack OK");
|
//LOGI("AudioTrack OK");
|
||||||
mAudioOut->start();
|
mAudioOut->start();
|
||||||
LOGI("AudioTrack started");
|
LOGI("AudioTrack started");
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ static tts_callback_status ttsSynthDoneCB(void *& userdata, uint32_t rate,
|
|||||||
SynthProxyJniStorage* pJniData = (SynthProxyJniStorage*)(pForAfter->jniStorage);
|
SynthProxyJniStorage* pJniData = (SynthProxyJniStorage*)(pForAfter->jniStorage);
|
||||||
|
|
||||||
if (pForAfter->usageMode == USAGEMODE_PLAY_IMMEDIATELY){
|
if (pForAfter->usageMode == USAGEMODE_PLAY_IMMEDIATELY){
|
||||||
LOGV("Direct speech");
|
//LOGV("Direct speech");
|
||||||
|
|
||||||
if (wav == NULL) {
|
if (wav == NULL) {
|
||||||
delete pForAfter;
|
delete pForAfter;
|
||||||
@@ -610,7 +610,7 @@ LOGI("android_tts_SynthProxy_playAudioBuffer");
|
|||||||
SynthProxyJniStorage* pSynthData = (SynthProxyJniStorage*)jniData;
|
SynthProxyJniStorage* pSynthData = (SynthProxyJniStorage*)jniData;
|
||||||
short* wav = (short*) bufferPointer;
|
short* wav = (short*) bufferPointer;
|
||||||
pSynthData->mAudioOut->write(wav, bufferSize);
|
pSynthData->mAudioOut->write(wav, bufferSize);
|
||||||
LOGI("AudioTrack wrote: %d bytes", bufferSize);
|
//LOGI("AudioTrack wrote: %d bytes", bufferSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
public static final int EARCON = 1;
|
public static final int EARCON = 1;
|
||||||
public static final int SILENCE = 2;
|
public static final int SILENCE = 2;
|
||||||
public static final int TEXT_TO_FILE = 3;
|
public static final int TEXT_TO_FILE = 3;
|
||||||
public String mText = null;
|
public String mText = "";
|
||||||
public ArrayList<String> mParams = null;
|
public ArrayList<String> mParams = null;
|
||||||
public int mType = TEXT;
|
public int mType = TEXT;
|
||||||
public long mDuration = 0;
|
public long mDuration = 0;
|
||||||
@@ -66,6 +66,7 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
|
|
||||||
public SpeechItem(long silenceTime) {
|
public SpeechItem(long silenceTime) {
|
||||||
mDuration = silenceTime;
|
mDuration = silenceTime;
|
||||||
|
mType = SILENCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpeechItem(String text, ArrayList<String> params, int itemType, String filename) {
|
public SpeechItem(String text, ArrayList<String> params, int itemType, String filename) {
|
||||||
@@ -125,7 +126,7 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
Log.i("TTS", "TTS starting");
|
//Log.i("TTS", "TTS starting");
|
||||||
|
|
||||||
mResolver = getContentResolver();
|
mResolver = getContentResolver();
|
||||||
|
|
||||||
@@ -231,7 +232,7 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
|
|
||||||
|
|
||||||
private int isLanguageAvailable(String lang, String country, String variant) {
|
private int isLanguageAvailable(String lang, String country, String variant) {
|
||||||
Log.v("TTS", "TtsService.isLanguageAvailable(" + lang + ", " + country + ", " +variant+")");
|
//Log.v("TTS", "TtsService.isLanguageAvailable(" + lang + ", " + country + ", " +variant+")");
|
||||||
return nativeSynth.isLanguageAvailable(lang, country, variant);
|
return nativeSynth.isLanguageAvailable(lang, country, variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +243,7 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
|
|
||||||
|
|
||||||
private int setLanguage(String lang, String country, String variant) {
|
private int setLanguage(String lang, String country, String variant) {
|
||||||
Log.v("TTS", "TtsService.setLanguage(" + lang + ", " + country + ", " + variant + ")");
|
//Log.v("TTS", "TtsService.setLanguage(" + lang + ", " + country + ", " + variant + ")");
|
||||||
if (isDefaultEnforced()) {
|
if (isDefaultEnforced()) {
|
||||||
return nativeSynth.setLanguage(getDefaultLanguage(), getDefaultCountry(),
|
return nativeSynth.setLanguage(getDefaultLanguage(), getDefaultCountry(),
|
||||||
getDefaultLocVariant());
|
getDefaultLocVariant());
|
||||||
|
|||||||
Reference in New Issue
Block a user