I want to use pocketsphinx.
when I run my model I got this error :
failed to init recognizer java.io.FileNotFoundException sync/assets.lst
but inside my asset there isn't this file (assets.lst
):
I don't understand this section of article :
http://cmusphinx.sourceforge.net/wiki/tutorialandroid#including_resource_files
Copy app/asset.xml build file from demo application into your application into same folder app. Edit app/build.gradle build file to run assets.xml, just as in android demo:
I'm using android studio and I have not app
directory in my model .
答案 0 :(得分:0)
请按照以下步骤操作:
sync
app/src/main/assets
的文件夹
将您创建的语言模型(https://cmusphinx.github.io/wiki/tutoriallm/)或位于:models/src/main/assets/sync
的演示项目中同步文件夹的所有内容复制到项目第一步中创建的文件夹中。< / p>
将以下行添加到app/build.gradle
:
ant.importBuild 'assets.xml'
preBuild.dependsOn(list, checksum)
clean.dependsOn(clean_assets)
同步您的gradle并使用演示
答案 1 :(得分:0)
I resolved this by manually cleaning up /HelloWorld/app/build.gradle to include all dependencies. File is,
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "net.blepsias.speakeasy"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
}
dependencies {
implementation project(':pocketsphinx')
implementation project(':models')
implementation 'com.android.support:appcompat-v7:26.1.0'
}
The previous file that was causing the failed-to-init error was generated by Android Studio had other stuff and was missing the pocketsphinx.aar reference. Lots of ways to skin this cat most likely...