2

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):

enter image description here

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 .

S.M_Emamian
  • 17,005
  • 37
  • 135
  • 254

2 Answers2

1

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...

portsample
  • 1,986
  • 4
  • 19
  • 35
0

Follow these steps :

  1. create a folder called sync on app/src/main/assets
  2. copy your created language model (https://cmusphinx.github.io/wiki/tutoriallm/) or all the content of sync folder in demo project which is located at : models/src/main/assets/sync to the created folder on step one on your project.

  3. add the following lines to your app/build.gradle :

    ant.importBuild 'assets.xml' preBuild.dependsOn(list, checksum) clean.dependsOn(clean_assets)

  4. sync your gradle and run your project with codes provided from demo

Armin
  • 2,397
  • 2
  • 21
  • 31