question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Initiate the ppn engine inside web workers using porcupine-web-**-factory packages

See original GitHub issue

Expected behaviour

The ‘Porcupine’ WASM module created via one of the web factories (e.g.: porcupine-web-en-factory) should work inside and outside of web workers.

Actual behaviour

Outside of Javascript web-workers (UI main thread) the Porcupine.create method works, inside of web workers it hangs indefinitely at pv_porcupine_init async (_context12, step 76).

Steps to reproduce the behaviour

  • Get the ‘@picovoice/porcupine-web-en-factory’ lib
  • set up your webpage
  • call const handle = await Porcupine.create(accessKey, [{builtin: "Bumblebee", sensitivity: 0.7}]); in UI main thread
  • call same function inside a web-worker

I’m assuming this is related to the validation of the access key, because data is stored in localStorage which cannot be accessed from web worker thread.

A related issue is that each time the localStorage is cleared a new machine ID will be generated and thus the browser will be regarded as new device. Since many systems will regularly clear the cache you will generate new ID constantly and run into the free tier limit immediately.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ksyeo1010commented, Jan 6, 2022

https://github.com/Picovoice/porcupine/pull/612 solves this issue. Get the latest package: 2.0.3.

0reactions
fquirincommented, Jan 6, 2022

Awesome, its working 🥳 Ty!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Initiate the ppn engine inside web workers using porcupine-web ...
The 'Porcupine' WASM module created via one of the web factories (e.g.: porcupine-web-en-factory) should work inside and outside of web workers.
Read more >
Untitled
Pricedrop tv presenters, Talayeh rezayat, Ma 137, Mac lip primer price in india, Flameslinger skillen, Nordie's, Dragon ball z episode 27 dublado, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found