TextToSpeech API,支持中文(需裝語音包)。調用簡單,無網絡依賴,但音質一般。eSpeak、Flite 移植到 Android,適合完全離線、無授權場景,但中文支持需額外詞典。TextToSpeech tts = new TextToSpeech(context, status -> {
if (status == TextToSpeech.SUCCESS) {
tts.setLanguage(Locale.CHINESE);
tts.speak("你好,世界", TextToSpeech.QUEUE_FLUSH, null, "utt1");
}
});
追求音質、離線可用 → 科大訊飛;簡單演示、聯網環境 → 系統 TTS 或百度在線 API;完全開源免授權 → 移植 eSpeak/Flite。