Picovoice / porcupine

On-device wake word detection powered by deep learning
https://picovoice.ai/
Apache License 2.0
3.7k stars 495 forks source link

Flutter background service #421

Closed FadiChaalab closed 3 years ago

FadiChaalab commented 3 years ago

Am trying to run it in background service but it keeps give me error about missing plugin exception no implementation found for method listen on channel flutter_voice_processor_events. I need to run it in background service, how to fix this issue?

kenarsa commented 3 years ago

duplicate of https://github.com/Picovoice/picovoice/issues/82

creating duplicate issues won't accelerate resolution and simply delays it by creating extra admin work.

FadiChaalab commented 3 years ago

I recreated the issue because i used porcupine flutter package and forgot to close it in the other one. Forgive me for my mistake but could you reopened again, i really need help on this issue.

FadiChaalab commented 3 years ago

This is my main page:

main dart - background_voice - Visual Studio Code 5_21_2021 6_43_29 PM

And speech_service.dart file has the initialize method for porcupineManager and all the logic that i need to fire get location and record sample of audio when the wake word detected. Everything work fine in foreground but when i try to run it in background service it fails with the error above. It seems that it fails because it can't determine if the app hasRecordAudioPermission in background.

laves commented 3 years ago

@FadiChaalab we've never claimed or attempted Porcupine Flutter on a background service. There is definitely some complications around running the cross-platform audio recorder outside the app. This is definitely a valid use-case that we'd like to support, but I can't promise we'll add this capability right away. We'll keep the issue open and hopefully someone can help you out in the meantime.

teganscott commented 3 years ago

Would this be why I can't get the flutter example on iOS to work with wake word when the app is not in the foreground?

olivermoo commented 2 years ago

Hi @kenarsa this issue was closed as completed, is there a background listener available for flutter, I don't seem to see anything? Similar to @FadiChaalab commented I get MissingPluginException(No implementation found for method listen on channel flutter_voice_processor_error_events) if I run it in Flutter Background Service Thank you in advance for any assistance.

EDIT: I got this working, the trick was to call the _porcupineManager start from within the initState in _MyAppState

kenarsa commented 2 years ago

@olivermoo that was my mistake. I closed the issue as not planned. We do have background recording for native Android and iOS but never claimed nor planned to add it to cross-platform mobile SDKs. If contributors what to add this based on our native SDKs we are very much open to PRs. Sorry about the confusion.

callmephil commented 5 months ago

Has there been any development on this feature since?