python - PicoVoice: Access PorcupinePvRecorder audio data, extract volumeaudio data? - Stack Overflow

admin2025-04-28  2

tl;dr: Is there any basic audio data that I can extract from PvRecorder, namely volume?

I have a python app that has voice-recognition technology, and I have been using PicoVoice's Porcupine for wake and it is working VERY well and I am pretty pleased with thier product. My app uses a semaphore to share the mic between my listener and Porcupine, which is fine.

But I do often have to "stop" PicoVoice from collecting audio data to allow my own listener to get audio data (namely volume). This does feel like a waste of perfectly good audio data-- and of course creates a possible wake word miss window.

My code has calls to these two objects (obviously I create them first, warning to googlers: the code below is not valid):

pvrRead = (PvRecorder).read()
result = (pvporcupine).process(pvrRead)

And I am wondering if there is any audio data that I can extract from the "pvrRead" data that Porcupine or PvRecorder records-- again, namely volume.

It would be *awesome * if I could convert the audio data "pvrRead" into a audio format that I can use with python's speech_recognition, but I am assuming this isn't possible.

Thanks!

tl;dr: Is there any basic audio data that I can extract from PvRecorder, namely volume?

I have a python app that has voice-recognition technology, and I have been using PicoVoice's Porcupine for wake and it is working VERY well and I am pretty pleased with thier product. My app uses a semaphore to share the mic between my listener and Porcupine, which is fine.

But I do often have to "stop" PicoVoice from collecting audio data to allow my own listener to get audio data (namely volume). This does feel like a waste of perfectly good audio data-- and of course creates a possible wake word miss window.

My code has calls to these two objects (obviously I create them first, warning to googlers: the code below is not valid):

pvrRead = (PvRecorder).read()
result = (pvporcupine).process(pvrRead)

And I am wondering if there is any audio data that I can extract from the "pvrRead" data that Porcupine or PvRecorder records-- again, namely volume.

It would be *awesome * if I could convert the audio data "pvrRead" into a audio format that I can use with python's speech_recognition, but I am assuming this isn't possible.

Thanks!

Share Improve this question asked Jan 9 at 18:39 El3ktraEl3ktra 111 silver badge4 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

So this was very easy. Just calculate the return value from PvRecorder.read():

pcm = recorder.read()    
volume = np.mean(np.abs(pcm))
转载请注明原文地址:http://anycun.com/QandA/1745779923a91187.html