You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Implement text-to-speech support on Android, iOS, HTML5, Linux, macOS and Windows.
Implement TextServer word break method.
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "java_godot_io_wrapper.h"
|
||||
#include "java_godot_wrapper.h"
|
||||
#include "os_android.h"
|
||||
#include "tts_android.h"
|
||||
|
||||
#if defined(VULKAN_ENABLED)
|
||||
#include "drivers/vulkan/rendering_device_vulkan.h"
|
||||
@@ -63,6 +64,7 @@ bool DisplayServerAndroid::has_feature(Feature p_feature) const {
|
||||
case FEATURE_ORIENTATION:
|
||||
case FEATURE_TOUCHSCREEN:
|
||||
case FEATURE_VIRTUAL_KEYBOARD:
|
||||
case FEATURE_TEXT_TO_SPEECH:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -73,6 +75,34 @@ String DisplayServerAndroid::get_name() const {
|
||||
return "Android";
|
||||
}
|
||||
|
||||
bool DisplayServerAndroid::tts_is_speaking() const {
|
||||
return TTS_Android::is_speaking();
|
||||
}
|
||||
|
||||
bool DisplayServerAndroid::tts_is_paused() const {
|
||||
return TTS_Android::is_paused();
|
||||
}
|
||||
|
||||
Array DisplayServerAndroid::tts_get_voices() const {
|
||||
return TTS_Android::get_voices();
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::tts_speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int p_utterance_id, bool p_interrupt) {
|
||||
TTS_Android::speak(p_text, p_voice, p_volume, p_pitch, p_rate, p_utterance_id, p_interrupt);
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::tts_pause() {
|
||||
TTS_Android::pause();
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::tts_resume() {
|
||||
TTS_Android::resume();
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::tts_stop() {
|
||||
TTS_Android::stop();
|
||||
}
|
||||
|
||||
void DisplayServerAndroid::clipboard_set(const String &p_text) {
|
||||
GodotJavaWrapper *godot_java = OS_Android::get_singleton()->get_godot_java();
|
||||
ERR_FAIL_COND(!godot_java);
|
||||
|
||||
Reference in New Issue
Block a user