Browse Source

Make mAvailableVoices final to avoid a lint warning on synchronized calls.

master
Reece H. Dunn 9 years ago
parent
commit
1f6d3eeb4b
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      android/src/com/reecedunn/espeak/TtsService.java

+ 1
- 2
android/src/com/reecedunn/espeak/TtsService.java View File

@@ -67,7 +67,7 @@ public class TtsService extends TextToSpeechService {
private SpeechSynthesis mEngine;
private SynthesisCallback mCallback;

private Map<String, Voice> mAvailableVoices;
private final Map<String, Voice> mAvailableVoices = new HashMap<String, Voice>();
private Voice mMatchingVoice = null;

private BroadcastReceiver mOnLanguagesDownloaded = null;
@@ -100,7 +100,6 @@ public class TtsService extends TextToSpeechService {
}

mEngine = new SpeechSynthesis(this, mSynthCallback);
mAvailableVoices = new HashMap<String, Voice>();
for (Voice voice : mEngine.getAvailableVoices()) {
mAvailableVoices.put(voice.name, voice);
}

Loading…
Cancel
Save