Skip to content

Commit

Permalink
Fixed jni compiling error associated with tts
Browse files Browse the repository at this point in the history
  • Loading branch information
leohwang committed Mar 28, 2024
1 parent 36de266 commit 3926c94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sherpa-onnx/jni/jni.cc
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ class SherpaOnnxOfflineTts {

GeneratedAudio Generate(
const std::string &text, int64_t sid = 0, float speed = 1.0,
std::function<void(const float *, int32_t)> callback = nullptr) const {
std::function<void(const float *, int32_t, float)> callback = nullptr) const {
return tts_.Generate(text, sid, speed, callback);
}

Expand Down Expand Up @@ -1308,8 +1308,8 @@ Java_com_k2fsa_sherpa_onnx_OfflineTts_generateWithCallbackImpl(
const char *p_text = env->GetStringUTFChars(text, nullptr);
SHERPA_ONNX_LOGE("string is: %s", p_text);

std::function<void(const float *, int32_t)> callback_wrapper =
[env, callback](const float *samples, int32_t n) {
std::function<void(const float *, int32_t, float)> callback_wrapper =
[env, callback](const float *samples, int32_t n, float /*p*/) {
jclass cls = env->GetObjectClass(callback);
jmethodID mid = env->GetMethodID(cls, "invoke", "([F)V");

Expand Down

0 comments on commit 3926c94

Please sign in to comment.