Porcupine Issue: adding audio player will stop wakeWordCallback from getting called again
See original GitHub issueExpected behaviour
wakeWordCallback
gets called every single time the trigger word is mentioned
Actual behaviour
wakeWordCallback
only gets called once. The moment an audio player is created, it stops getting called.
Steps to reproduce the behaviour
- Clone https://github.com/geekyme/picovoice_test
flutter run
- Say “jarvis”, an audio will be played
- Repeat Step 3 and it will no longer work.
Revert the commit for adding the audio - https://github.com/geekyme/picovoice_test/commit/cf1f5d5137e1620b6fc7c84d514bed461ae46216
Now perform step 3 and 4, the callback will be triggered every time you say “jarvis”. Somehow, adding that audio player stops porcupine from working correctly.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Unable to start speech Recognition after porcupine wake word ...
So I have tried to stop the porcupineManager.stop() (To stop from porcupine to listen) then initialized speech recognition and to start ...
Read more >Picovoice - Bountysource
wakeWordCallback only gets called once. The moment an audio player is created, it stops getting called. Steps to reproduce the behaviour. 1) Clone...
Read more >Audio player | Documents Knowledge Base
The smart and beautiful media player organizes folders into playlists with the ability to shuffle and loop your favorite tracks. Jump to: Add...
Read more >AudioPlayer Interface Reference | Alexa Skills Kit
(again, no invocation name.) Alexa opens a new skill session and sends the skill AMAZON.PauseIntent . My Podcast Player sends a Stop ......
Read more >In AVAudioPlayer after a pause the song does not continue on ...
do { audioPlayer = try AVAudioPlayer(contentsOfURL: mySound) audioPlayer!.prepareToPlay() } catch { print("Error getting the audio file") } }.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@geekyme we’ve scheduled someone to take a look at this in the coming weeks. Thank you for your patience.
@geekyme, we’ve spent some time looking at this and it seems this is not necessarily a problem with Picovoice or our flutter audio recorder plugin - more of a combination of bad assumptions made by Apple and these audio player plugins.
The problem is related to iOS’s AVAudioSession. Each iOS app has a single audio session assigned to it that can be configured to do certain things. For our purposes, we enable recording and playback so that we can take in microphone audio, but still allow audio to be played. When you play a sound using these audio player plugins, they switch the audio session to playback only, which turns off audio recording. As a result, our Picovoice plugin stops receiving audio and cannot perform speech recognition. Apple assumes each app will have complete control over its own audio session, so this changing of settings is not considered an interruption event and cannot be handled like other audio interruptions. If you use any other flutter audio recording plugin, start recording, play a sound using one of these plugins, you’ll see they stop recording audio as well.
Unfortunately, there is no great way around this from our perspective. We’ve added extra error handling to detect when we’ve lost audio, but we cannot do much more at this time. I’d recommend you’d report this problem to the developers of the plugins you are trying to use and recommend that they not shut off recording capabilities when they play audio (or at least make it configurable).