Backport text-to-speech support.

This commit is contained in:
bruvzg 2022-05-23 15:02:12 +03:00
parent 2882eaab28
commit 6489fe890e
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
45 changed files with 3905 additions and 2 deletions

View file

@ -48,6 +48,7 @@
#include "os_android.h"
#include "string_android.h"
#include "thread_jandroid.h"
#include "tts_android.h"
#include <android/input.h>
#include <unistd.h>
@ -136,6 +137,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en
DirAccessJAndroid::setup(p_directory_access_handler);
FileAccessFilesystemJAndroid::setup(p_file_access_handler);
NetSocketAndroid::setup(p_net_utils);
TTS_Android::setup(godot_java->get_member_object("tts", "Lorg/godotengine/godot/tts/GodotTTS;", env));
os_android = new OS_Android(godot_java, godot_io_java, p_use_apk_expansion);
@ -237,6 +239,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_back(JNIEnv *env, jcl
}
}
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_ttsCallback(JNIEnv *env, jclass clazz, jint event, jint id, jint pos) {
TTS_Android::_java_utterance_callback(event, id, pos);
}
JNIEXPORT jboolean JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, jclass clazz) {
if (step.get() == -1) {
return true;