正在显示
1 个修改的文件
包含
3 行增加
和
1 行删除
| @@ -18,7 +18,9 @@ static jobjectArray ReadWaveImpl(JNIEnv *env, std::istream &is, | @@ -18,7 +18,9 @@ static jobjectArray ReadWaveImpl(JNIEnv *env, std::istream &is, | ||
| 18 | 18 | ||
| 19 | if (!is_ok) { | 19 | if (!is_ok) { |
| 20 | SHERPA_ONNX_LOGE("Failed to read '%s'", p_filename); | 20 | SHERPA_ONNX_LOGE("Failed to read '%s'", p_filename); |
| 21 | - exit(-1); | 21 | + jclass exception_class = env->FindClass("java/lang/Exception"); |
| 22 | + env->ThrowNew(exception_class, "Failed to read wave file."); | ||
| 23 | + return nullptr; | ||
| 22 | } | 24 | } |
| 23 | 25 | ||
| 24 | jfloatArray samples_arr = env->NewFloatArray(samples.size()); | 26 | jfloatArray samples_arr = env->NewFloatArray(samples.size()); |
-
请 注册 或 登录 后发表评论