我正在使用android-alize作为演讲者识别应用。正如文档所说,我正在尝试如下训练模型,
//将音频发送到系统 alizeSystem.addAudio(音频);
//使用音频训练模型 alizeSystem.createSpeakerModel( “有人”);
但是我的应用程序崩溃了下面的stacktrace,
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
感谢您的输入
答案 0 :(得分:0)
进一步调试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();
}
我设法从谷歌搜索中找到了一个world.gmm,当我将它添加到我的android项目时,错误消失了。然而,预测并不准确。
因此,我正在进一步研究LIA_RAL源代码,通过提供满足我要求的音频数据(音频样本)来生成这个world.gmm(UBM)。