Android Question Porcupine hotword creation

Multiverse app

Active Member
Licensed User
Longtime User
Porcupine is a hotword recognition tool, like "Ok Google" and "Alexa". The library created by donmanfred works very well with predefined hotwords.

But when I tried creating my own hotword the library fails to initialize.
I am using Windows, and this is the command-
B4X:
E:\porcupine\pv_porcupine_optimizer -r E:\porcupine -w "extreme" -p windows -o E:\porcupine

in "E:\porcupine" directory, I have the following files-
porcupine.data
params.pv
pv_porcupine_optimizer.exe

I placed the generated "extreme_windows.ppn" file under "File.DirRootExternal&"/porcupine" folder. When run, the following error occurs:

B4X:
Error occurred on line: 48 (Main)
ai.picovoice.porcupinemanager.PorcupineManagerException: ai.picovoice.porcupine.PorcupineException: java.lang.IllegalArgumentException: Initialization of Porcupine failed.
    at ai.picovoice.porcupinemanager.PorcupineManager.<init>(PorcupineManager.java:110)
    at de.donmanfred.Porcupinewrapper.Initialize(Porcupinewrapper.java:63)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:755)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:345)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
    at b4a.example.main.afterFirstLayout(main.java:104)
    at b4a.example.main.access$000(main.java:17)
    at b4a.example.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5265)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Caused by: ai.picovoice.porcupine.PorcupineException: java.lang.IllegalArgumentException: Initialization of Porcupine failed.
    at ai.picovoice.porcupine.Porcupine.<init>(Porcupine.java:49)
    at ai.picovoice.porcupinemanager.PorcupineManager.<init>(PorcupineManager.java:108)
    ... 20 more
Caused by: java.lang.IllegalArgumentException: Initialization of Porcupine failed.
    at ai.picovoice.porcupine.Porcupine.init(Native Method)
    at ai.picovoice.porcupine.Porcupine.<init>(Porcupine.java:47)
    ... 21 more
** Activity (main) Resume **


My example code- https://drive.google.com/open?id=1qEmR9kVJ2sHqk575UW8W0ZRc6PrzZHpN
I've attached the generated hotword.
 

Attachments

  • extreme_windows.zip
    220 bytes · Views: 296
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Please remove the Library! I did not allowed to publish the library.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
As far i can help (unfortunately the lib still does not work for me).

I found out that the files generated by the Windowstool seems to be not able to create Files for ANDROID!?

Now i found this (Optimizer/readme.md)
This means that a keyword file generated with ```-p linux``` cannot run on Android or Mac. The
optimizer available at this repository can produce keyword files for Linux, Mac, and Windows platforms. Custom keyword files for other
platforms are provided with a purchase of the commercial license. In order to purchase a commercial license contact [email protected].

So, if you need to create keywords for Android you need to buy a License. Don´t know what it costs/how much it is. You need to contact [email protected]
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Can you tell us more about this wonderful library?
It is a wrap for this Github project.

Keywords available:
10.05.2018 16:27 76 alexa_android.ppn
10.05.2018 16:27 76 alexa_ios.ppn
10.05.2018 16:27 76 alexa_linux.ppn
10.05.2018 16:27 76 alexa_mac.ppn
10.05.2018 16:27 76 alexa_raspberrypi.ppn
10.05.2018 16:27 76 alexa_windows.ppn
10.05.2018 16:27 92 americano_android.ppn
10.05.2018 16:27 92 americano_ios.ppn
10.05.2018 16:27 92 americano_linux.ppn
10.05.2018 16:27 92 americano_mac.ppn
10.05.2018 16:27 92 americano_raspberrypi.ppn
10.05.2018 16:27 92 americano_windows.ppn
10.05.2018 16:27 84 avocado_android.ppn
10.05.2018 16:27 84 avocado_ios.ppn
10.05.2018 16:27 84 avocado_linux.ppn
10.05.2018 16:27 84 avocado_mac.ppn
10.05.2018 16:27 84 avocado_raspberrypi.ppn
10.05.2018 16:27 84 avocado_windows.ppn
10.05.2018 16:27 84 blueberry_android.ppn
10.05.2018 16:27 84 blueberry_ios.ppn
10.05.2018 16:27 84 blueberry_linux.ppn
10.05.2018 16:27 84 blueberry_mac.ppn
10.05.2018 16:27 84 blueberry_raspberrypi.ppn
10.05.2018 16:27 84 blueberry_windows.ppn
10.05.2018 16:27 88 bumblebee_android.ppn
10.05.2018 16:27 88 bumblebee_ios.ppn
10.05.2018 16:27 88 bumblebee_linux.ppn
10.05.2018 16:27 88 bumblebee_mac.ppn
10.05.2018 16:27 88 bumblebee_raspberrypi.ppn
10.05.2018 16:27 88 bumblebee_windows.ppn
10.05.2018 16:27 92 caterpillar_android.ppn
10.05.2018 16:27 92 caterpillar_ios.ppn
10.05.2018 16:27 92 caterpillar_linux.ppn
10.05.2018 16:27 92 caterpillar_mac.ppn
10.05.2018 16:27 92 caterpillar_raspberrypi.ppn
10.05.2018 16:27 92 caterpillar_windows.ppn
10.05.2018 16:27 88 christina_android.ppn
10.05.2018 16:27 88 christina_ios.ppn
10.05.2018 16:27 88 christina_linux.ppn
10.05.2018 16:27 88 christina_mac.ppn
10.05.2018 16:27 88 christina_raspberrypi.ppn
10.05.2018 16:27 88 christina_windows.ppn
10.05.2018 16:27 92 dragonfly_android.ppn
10.05.2018 16:27 92 dragonfly_ios.ppn
10.05.2018 16:27 92 dragonfly_linux.ppn
10.05.2018 16:27 92 dragonfly_mac.ppn
10.05.2018 16:27 92 dragonfly_raspberrypi.ppn
10.05.2018 16:27 92 dragonfly_windows.ppn
10.05.2018 16:27 88 flamingo_android.ppn
10.05.2018 16:27 88 flamingo_ios.ppn
10.05.2018 16:27 88 flamingo_linux.ppn
10.05.2018 16:27 88 flamingo_mac.ppn
10.05.2018 16:27 88 flamingo_raspberrypi.ppn
10.05.2018 16:27 88 flamingo_windows.ppn
10.05.2018 16:27 92 francesca_android.ppn
10.05.2018 16:27 92 francesca_ios.ppn
10.05.2018 16:27 92 francesca_linux.ppn
10.05.2018 16:27 92 francesca_mac.ppn
10.05.2018 16:27 92 francesca_raspberrypi.ppn
10.05.2018 16:27 92 francesca_windows.ppn
10.05.2018 16:27 88 grapefruit_android.ppn
10.05.2018 16:27 88 grapefruit_ios.ppn
10.05.2018 16:27 88 grapefruit_linux.ppn
10.05.2018 16:27 88 grapefruit_mac.ppn
10.05.2018 16:27 88 grapefruit_raspberrypi.ppn
10.05.2018 16:27 88 grapefruit_windows.ppn
10.05.2018 16:27 92 grasshopper_android.ppn
10.05.2018 16:27 92 grasshopper_ios.ppn
10.05.2018 16:27 92 grasshopper_linux.ppn
10.05.2018 16:27 92 grasshopper_mac.ppn
10.05.2018 16:27 92 grasshopper_raspberrypi.ppn
10.05.2018 16:27 92 grasshopper_windows.ppn
10.05.2018 16:27 76 iguana_android.ppn
10.05.2018 16:27 76 iguana_ios.ppn
10.05.2018 16:27 76 iguana_linux.ppn
10.05.2018 16:27 76 iguana_mac.ppn
10.05.2018 16:27 76 iguana_raspberrypi.ppn
10.05.2018 16:27 76 iguana_windows.ppn
15.05.2018 19:14 0 listing.txt
10.05.2018 16:27 84 picovoice_android.ppn
10.05.2018 16:27 84 picovoice_ios.ppn
10.05.2018 16:27 84 picovoice_linux.ppn
10.05.2018 16:27 84 picovoice_mac.ppn
10.05.2018 16:27 84 picovoice_raspberrypi.ppn
10.05.2018 16:27 84 picovoice_windows.ppn
10.05.2018 16:27 84 pineapple_android.ppn
10.05.2018 16:27 84 pineapple_ios.ppn
10.05.2018 16:27 84 pineapple_linux.ppn
10.05.2018 16:27 84 pineapple_mac.ppn
10.05.2018 16:27 84 pineapple_raspberrypi.ppn
10.05.2018 16:27 84 pineapple_windows.ppn
10.05.2018 16:27 92 porcupine_android.ppn
10.05.2018 16:27 92 porcupine_ios.ppn
10.05.2018 16:27 92 porcupine_linux.ppn
10.05.2018 16:27 92 porcupine_mac.ppn
10.05.2018 16:27 92 porcupine_raspberrypi.ppn
10.05.2018 16:27 92 porcupine_windows.ppn
10.05.2018 16:27 84 raspberry_android.ppn
10.05.2018 16:27 84 raspberry_ios.ppn
10.05.2018 16:27 84 raspberry_linux.ppn
10.05.2018 16:27 84 raspberry_mac.ppn
10.05.2018 16:27 84 raspberry_raspberrypi.ppn
10.05.2018 16:27 84 raspberry_windows.ppn
10.05.2018 16:27 88 terminator_android.ppn
10.05.2018 16:27 88 terminator_ios.ppn
10.05.2018 16:27 88 terminator_linux.ppn
10.05.2018 16:27 88 terminator_mac.ppn
10.05.2018 16:27 88 terminator_raspberrypi.ppn
10.05.2018 16:27 88 terminator_windows.ppn
10.05.2018 16:27 84 vancouver_android.ppn
10.05.2018 16:27 84 vancouver_ios.ppn
10.05.2018 16:27 84 vancouver_linux.ppn
10.05.2018 16:27 84 vancouver_mac.ppn
10.05.2018 16:27 84 vancouver_raspberrypi.ppn
10.05.2018 16:27 84 vancouver_windows.ppn
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I was HELPFUL with this library too! I DID WROTE IT
I don´t care about the 5 minutes you was too lazy to build the example by yourself.
I deciced NOT to react on Posts from you. Private or open.

Thank you. I don't have the skills to develop a B4A project on the basis of just a JAR, XML and some RAW data. If you don't have the time to make a test project I have no other choice than to let it rest (i.e. no donation, sorry).

Please do not ask me about any Library anymore.
 
Last edited:
Upvote 0

coslad

Well-Known Member
Licensed User
Longtime User
Hi Don

it is a shame not to share your work , maybe into a donationware formula .

Or send me Pm with your price .

Think about it , the voice commands are the new future and do it with B4A will be great !!
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You are not able to create new commands with this library. At least not for Android. You need a Commercial License for this.
Additionally the lib still does not work for me. Maybe my Device (Android 8). I don´t know.
I would feel bad if i release it.
 
Upvote 0

coslad

Well-Known Member
Licensed User
Longtime User
Many thanks for your reply:) , it is a shame !

I will continue trying to understand Google action command :(
 
Upvote 0

Multiverse app

Active Member
Licensed User
Longtime User
You are not able to create new commands with this library. At least not for Android. You need a Commercial License for this.
Additionally the lib still does not work for me. Maybe my Device (Android 8). I don´t know.
I would feel bad if i release it.
It worked fine on my Android 8 device o_O
What issue are you facing?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
What issue are you facing?
The initialization does work (i guess). in resume i start and when i try to activate the Keyword used (Alexa_Android) the Lib (the Native) just crashes.
I only could find something in the unfiltered log. But nothing which i could understand.

As i am not interested in this Library i just put it by side... No problem for me at all.

I´m glad it works for you...
 
Upvote 0
Top