-
Notifications
You must be signed in to change notification settings - Fork 40
[ANDROID][SDK] Add get phoneme support #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
void-memories
merged 24 commits into
NimbleEdge:main
from
void-memories:naman/android/espeak-decoupling
Aug 12, 2025
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
5423a74
implement multi args jni bridge
void-memories 76d2411
revert use of jniString
void-memories 55a07a5
fix function case
void-memories 56ebec5
update config.yml
void-memories 44c8f7d
Merge remote-tracking branch 'upstream/main' into naman/android/espea…
void-memories 7f10e4f
merge with main
void-memories 17c49dd
release 0.0.1-dev-7f10e4f-20250807
void-memories 7e90ae1
remove ios ifdef
void-memories 43b1948
update ios ifdef
void-memories 5f42343
release
void-memories 0c913f4
add headers
void-memories 6acede4
remove redundant fns
void-memories 51d31b5
Cosmetics
jpuneet f98987d
Cosmetics
jpuneet 92d1f91
Cosmetics
jpuneet 26a1b71
Cosmetics
jpuneet 042958c
Cosmetics
jpuneet dc136bc
Cosmetics
jpuneet a8e45b5
Cosmetics
jpuneet 6ebed4e
Cosmetics
jpuneet 1fda7b7
Cosmetics
jpuneet 635d132
Cosmetics
jpuneet 1827113
Fixes
jpuneet 58bfd1a
format kotlin
void-memories File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
coreruntime/platform/android/include/native_request_receiver_shadow.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: (C) 2025 DeliteAI Authors | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <jni.h> | ||
|
|
||
| #include <string> | ||
|
|
||
| class NativeRequestReceiverShadow { | ||
| public: | ||
| static void init(JNIEnv* env); | ||
| static jobject dispatch(JNIEnv* env, const std::string& functionName, int argCount, ...); | ||
|
|
||
| private: | ||
| inline static jclass nativeRequestReceiverClass = nullptr; | ||
| inline static jmethodID dispatchMethodId = nullptr; | ||
| inline static jobject nativeRequestReceiverKotlinInstance = nullptr; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
coreruntime/platform/android/src/native_request_receiver_shadow.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: (C) 2025 DeliteAI Authors | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include "native_request_receiver_shadow.hpp" | ||
|
|
||
| #include <cstdarg> | ||
| #include <string> | ||
|
|
||
| #include "../../jni/utils/jni_logger.h" | ||
| #include "client.h" | ||
| #include "dependency_container_shadow.hpp" | ||
|
|
||
| void NativeRequestReceiverShadow::init(JNIEnv* env) { | ||
| if (!env) return; | ||
|
|
||
| jclass localClass = env->FindClass("dev/deliteai/impl/nativeBridge/NativeRequestReceiver"); | ||
| if (!localClass) { | ||
| LOGE("Class dev.deliteai.impl.nativeBridge.NativeRequestReceiver not found.\n"); | ||
| return; | ||
| } | ||
|
|
||
| nativeRequestReceiverClass = static_cast<jclass>(env->NewGlobalRef(localClass)); | ||
| env->DeleteLocalRef(localClass); | ||
|
|
||
| if (!nativeRequestReceiverClass) { | ||
| LOGE("Failed to create global reference for NativeRequestReceiver class.\n"); | ||
| return; | ||
| } | ||
|
|
||
| dispatchMethodId = | ||
| env->GetMethodID(nativeRequestReceiverClass, "dispatch", | ||
| "(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;"); | ||
| if (!dispatchMethodId) { | ||
| LOGE("Method dispatch not found.\n"); | ||
| } | ||
|
|
||
| auto nativeRequestReceiverKotlinInstanceLocal = DependencyContainerShadow::getNativeRequestReceiverInstance(env); | ||
| nativeRequestReceiverKotlinInstance = env->NewGlobalRef(nativeRequestReceiverKotlinInstanceLocal); | ||
| env->DeleteLocalRef(nativeRequestReceiverKotlinInstanceLocal); | ||
| } | ||
|
|
||
| jobject NativeRequestReceiverShadow::dispatch(JNIEnv* env, const std::string& functionName, int argCount, ...) { | ||
| if (!nativeRequestReceiverKotlinInstance) { | ||
| LOGE("nativeRequestReceiverKotlinInstance is null in dispatch.\n"); | ||
| return nullptr; | ||
| } | ||
|
|
||
| jstring jFunctionName = env->NewStringUTF(functionName.c_str()); | ||
|
|
||
| // Create an array with the specified number of arguments | ||
| jclass objectClass = env->FindClass("java/lang/Object"); | ||
| jobjectArray argsArray = env->NewObjectArray(argCount, objectClass, nullptr); | ||
| env->DeleteLocalRef(objectClass); | ||
|
|
||
| // Process variable arguments | ||
| va_list args; | ||
| va_start(args, argCount); | ||
| for (int i = 0; i < argCount; i++) { | ||
| jobject arg = va_arg(args, jobject); | ||
| env->SetObjectArrayElement(argsArray, i, arg); | ||
| } | ||
| va_end(args); | ||
|
|
||
| jobject result = | ||
| env->CallObjectMethod(nativeRequestReceiverKotlinInstance, dispatchMethodId, jFunctionName, argsArray); | ||
|
|
||
| env->DeleteLocalRef(jFunctionName); | ||
| env->DeleteLocalRef(argsArray); | ||
|
|
||
| return result; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.