just-ai / aimybox-android-sdk

Voice assistant SDK for Android
https://aimybox.com
Apache License 2.0
77 stars 16 forks source link

How do I open a pmdl file for Snowboy Voice Trigger ? #76

Closed julenmerchan closed 3 years ago

julenmerchan commented 4 years ago

Hi, first of all many thanks for you awasome job. I'm trying to integrate voice trigger in my app but every time i get this error when I try to open my pmdl file:

Aimybox(SnowboySpeechkit): [main] Failed to copy robot.pmdl from assets to SD java.io.FileNotFoundException: robot.pmdl

I've tried a lot of things such as: copy my model file in different directories, changing the path in the code... but nothing works. This is the code of my function:

@SuppressLint("MissingPermission") fun createSnowboy(context: Context): SnowboyVoiceTrigger { // If you provide snowboy assets with your APK

    val assets = SnowboyAssets.fromApkAssets(context,"robot.pmdl", "src/main/res/raw")

    return SnowboyVoiceTrigger(context,assets)

}
morfeusys commented 4 years ago

You don't have to refer to the src folder, use only a relative path to the file, as described in snowboy module readme. By the way, I recommend to use kaldi instead of frozen snowboy.