How to create new WASM keyword signatures
See original GitHub issueIssue
I’m using windows and trying to adapt the js demo for use in nodejs (btw that would be a really useful demo, and i’m happy to submit a pr once I figure this out!).
I can run the example in firefox locally fine 👍
I’m now trying to create my own keyword signature using the optimiser tool:
$ tools/optimizer/windows/amd64/pv_porcupine_optimizer.exe -r resources/ -p windows -o . -w "ok l
amp"
in this case i’m copying the existing keyword “ok lamp” to see if I can create the same Uint8Array, or just to at least see it work with a keyword i’ve generated.
I’m using xxd to convert the output file into a hexadecimal string.
$ xxd -p ok\ lamp_windows.ppn
ebb54e7a075a872fdf7d87cb23da698f3c19141120c27327d6ceff8c6c65
2c85f196e30f22dda6d7bab3f5289e9a261cfd943de716f81760d4f820c3
0f67f4bbf14301e993e5048c9197e638c7bcdc805b483642675f086b
then I format the output to copy the demo, i.e.
0xeb, 0xb5, 0x4e, 0x7a, 0x07, 0x5a, 0x87, 0x2f, 0xdf, 0x7d, 0x87, 0xcb, 0x23, 0xda, 0x69, 0x8f, 0x3c, 0x19, 0x14, 0x11, 0x20, 0xc2, 0x73, 0x27, 0xd6, 0xce, 0xff, 0x8c, 0x6c, 0x65, 0x2c, 0x85, 0xf1, 0x96, 0xe3, 0x0f, 0x22, 0xdd, 0xa6, 0xd7, 0xba, 0xb3, 0xf5, 0x28, 0x9e, 0x9a, 0x26, 0x1c, 0xfd, 0x94, 0x3d, 0xe7, 0x16, 0xf8, 0x17, 0x60, 0xd4, 0xf8, 0x20, 0xc3, 0x0f, 0x67, 0xf4, 0xbb, 0xf1, 0x43, 0x01, 0xe9, 0x93, 0xe5, 0x04, 0x8c, 0x91, 0x97, 0xe6, 0x38, 0xc7, 0xbc, 0xdc, 0x80, 0x5b, 0x48, 0x36, 0x42, 0x67, 0x5f, 0x08, 0x6b
pop that in the demo file in-place of the existing “ok lamp” value and run the local demo to no avail. I get the following error:
[ERROR] keyword file has incorrect format or belongs to a different platform
[ERROR] parsing keyword ID #0 failed with 'INVALID_ARGUMENT'
Questions
- How do I create the Uint8Array values from a generated ppn file?
- Is there a special wasm platform target in the optimiser tool since the web in general and wasm is platform agnostic, so which platform should I use from the list?
for example: I can see there are *_wasm.ppn files in the /resources directory,
p.s. this is a super fricking cool project 🙂
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Check out v1.5 now you have about 20 more models in the resource directory. hope it helps.
can you add “Computer” (like in Startrek)… that would help me a lot with my private voice control…?
Thank you very much