Skip to content
Advertisement

Overflow – reader is not reading fast enough PyAudio

I’m currently trying to build a voice assistant with Python when I ran into a problem. I’m using porcupine/picovoice for wakeword detection and then I call a function that recognizes everything I say as soon as I call it.

This is the function:

JavaScript

If i just call the function alone, it works perfectly fine, recognizes what I say and then prints it out.

But the problem is that as soon as I use it together with the wakeword detector, I get spammed with Overflow – reader is not reading fast enough after A moment of silence, please… is printed out.

This is the wakeword detection code, works fine on it’s own as well as in the script, the problem seems to be in the recognizing part

JavaScript

I am honestly clueless why its not working. Hope to find a solution tho!

Advertisement

Answer

I’m working on a similar task and running into the same issue. I’ve found that the solution is to avoid using two different means of recording audio.

The PvRecorder class represents the recorded data as signed integers.

JavaScript

This is different AFAIK than how wav data is typically stored in an audio file. If you look to how PvRecorder saves wav files, you can see they use the struct module:

JavaScript

You can use that to construct the audio file to pass along. I’m using it with Vosk and it works great!

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement