执行 alizeSystem.createSpeakerModel(userName) 时因 "UBM not found" 而崩溃;
Crashing with "UBM not found" when executing alizeSystem.createSpeakerModel(userName);
我正在使用 android-alize 作为说话人识别应用。正如文档所说,我正在尝试训练如下模型,
// 向系统发送音频
alizeSystem.addAudio(音频);
// 用音频训练模型
alizeSystem.createSpeakerModel("Somebody");
但是我的应用程序因以下堆栈跟踪而崩溃,
04-17 14:29:31.216 5546-5546/com.example.channa.poc_alize W/IInputConnectionWrapper: getTextAfterCursor on inactive InputConnection
04-17 14:29:31.253 5546-5546/com.example.channa.poc_alize W/IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection
04-17 14:29:31.253 5546-5546/com.example.channa.poc_alize W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
04-17 14:29:33.184 5546-5546/com.example.channa.poc_alize I/System.out: content://com.android.externalstorage.documents/document/primary%3AAudioClipsForSpeakerRecognition%2F1%2Fspeaker_1.wav
04-17 14:29:34.155 5546-5546/com.example.channa.poc_alize W/System.err: AlizeSpkRec.AlizeException: [ Exception 0x7c4ca25480 ]
message = "UBM not found"
source file = /Users/channa/Documents/Projects/Work/Sample Projects/android-alize/alize/src/main/cpp/LIA_RAL/LIA_SpkDet/SimpleSpkDetSystem/src/SimpleSpkDetSystem.cpp
line number = 869
at AlizeSpkRec.SimpleSpkDetSystem.createSpeakerModel(Native Method)
at com.example.channa.poc_alize.SpeakerRecognition.trainSpeakerModel(SpeakerRecognition.java:40)
at com.example.channa.poc_alize.MainActivity.onActivityResult(MainActivity.java:97)
at android.app.Activity.dispatchActivityResult(Activity.java:7226)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4477)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4524)
at android.app.ActivityThread.-wrap22(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1691)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6692)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
04-17 14:29:34.182 5546-5586/com.example.channa.poc_alize D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000, [1440x2560]-format:1
04-17 14:29:34.183 5546-5546/com.example.channa.poc_alize D/ViewRootImpl@52672bd[MainActivity]: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
MSG_WINDOW_FOCUS_CHANGED 1
感谢您的意见
进一步调试Alize-LIA_RAL,发现android项目在assets/gmm/world.gmm中寻找world.gmm(UBM)。似乎我们必须使用 LIA_RAL 库生成此 world.gmm,然后将其添加到 android 代码中。
但是我们必须在 alize 初始化期间使用下面给定的代码片段指定 UBM 位置。
InputStream backgroundModelAsset = null;
try {
backgroundModelAsset = context.getAssets().open("gmm/world.gmm");
alizeSystem.loadBackgroundModel(backgroundModelAsset);
backgroundModelAsset.close();
} catch (IOException e) {
e.printStackTrace();
} catch (AlizeException e) {
e.printStackTrace();
}
我设法从 google 搜索中找到了一个 world.gmm,当我将它添加到我的 android 项目时,错误消失了。然而,预测并不准确。
因此,我正在进一步研究 LIA_RAL 源代码以通过提供满足我要求的训练数据(音频样本)来生成此 world.gmm (UBM)。
我正在使用 android-alize 作为说话人识别应用。正如文档所说,我正在尝试训练如下模型,
// 向系统发送音频 alizeSystem.addAudio(音频);
// 用音频训练模型 alizeSystem.createSpeakerModel("Somebody");
但是我的应用程序因以下堆栈跟踪而崩溃,
04-17 14:29:31.216 5546-5546/com.example.channa.poc_alize W/IInputConnectionWrapper: getTextAfterCursor on inactive InputConnection
04-17 14:29:31.253 5546-5546/com.example.channa.poc_alize W/IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection
04-17 14:29:31.253 5546-5546/com.example.channa.poc_alize W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
04-17 14:29:33.184 5546-5546/com.example.channa.poc_alize I/System.out: content://com.android.externalstorage.documents/document/primary%3AAudioClipsForSpeakerRecognition%2F1%2Fspeaker_1.wav
04-17 14:29:34.155 5546-5546/com.example.channa.poc_alize W/System.err: AlizeSpkRec.AlizeException: [ Exception 0x7c4ca25480 ]
message = "UBM not found"
source file = /Users/channa/Documents/Projects/Work/Sample Projects/android-alize/alize/src/main/cpp/LIA_RAL/LIA_SpkDet/SimpleSpkDetSystem/src/SimpleSpkDetSystem.cpp
line number = 869
at AlizeSpkRec.SimpleSpkDetSystem.createSpeakerModel(Native Method)
at com.example.channa.poc_alize.SpeakerRecognition.trainSpeakerModel(SpeakerRecognition.java:40)
at com.example.channa.poc_alize.MainActivity.onActivityResult(MainActivity.java:97)
at android.app.Activity.dispatchActivityResult(Activity.java:7226)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4477)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4524)
at android.app.ActivityThread.-wrap22(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1691)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6692)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
04-17 14:29:34.182 5546-5586/com.example.channa.poc_alize D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000, [1440x2560]-format:1
04-17 14:29:34.183 5546-5546/com.example.channa.poc_alize D/ViewRootImpl@52672bd[MainActivity]: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
MSG_WINDOW_FOCUS_CHANGED 1
感谢您的意见
进一步调试Alize-LIA_RAL,发现android项目在assets/gmm/world.gmm中寻找world.gmm(UBM)。似乎我们必须使用 LIA_RAL 库生成此 world.gmm,然后将其添加到 android 代码中。
但是我们必须在 alize 初始化期间使用下面给定的代码片段指定 UBM 位置。
InputStream backgroundModelAsset = null;
try {
backgroundModelAsset = context.getAssets().open("gmm/world.gmm");
alizeSystem.loadBackgroundModel(backgroundModelAsset);
backgroundModelAsset.close();
} catch (IOException e) {
e.printStackTrace();
} catch (AlizeException e) {
e.printStackTrace();
}
我设法从 google 搜索中找到了一个 world.gmm,当我将它添加到我的 android 项目时,错误消失了。然而,预测并不准确。
因此,我正在进一步研究 LIA_RAL 源代码以通过提供满足我要求的训练数据(音频样本)来生成此 world.gmm (UBM)。