StevenHickson / PiAUISuite

Raspberry PI AUI Suite
Other
695 stars 204 forks source link

Verify==1 keyword not working #88

Open symatix opened 7 years ago

symatix commented 7 years ago

Hello Steven! First I want to say - awesome package! 👍 But I am having trouble making keyword verification to work. So far I have changed tts to pico2wave so I am getting sound if verification is set to 0. The commands also work, but it is triggered by every sound and it is not usable if I don't look at the monitor to see if it is ready for input or it is already processing something. If I put !verify==1 in to conf file, there is no audio out coming from voicecommand and it starts to continuously record. Of course, multiple attempts of saying the keyword, from whisper to shouting yielded no result..

My conf file is

!continuous==1
!verify==1
!ignore==1
!filler==0
!response==Master?
!thresh==1.2
!keyword==anybody
~music==mpsyt playurl https://www.youtube.com/watch?v=ljQsRLN2dXA
~stop==sudo pkill mpsyt
~ressurect==tts "I live!"

when verify is set to 0, the output is this

Found audio
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 62561    0   436  100 62125    187  26761  0:00:02  0:00:02 --:--:-- 26778
command: mpsyt playurl https://www.youtube.com/watch?v=ljQsRLN2dXA
Chillhop Cafe · jazzy ' lofi hip hop radio  · beats for studying / work

but when it is set to 1, it will always recognize audio input, but not the keyword, so the output looks like this

Opening config file...
Not querying for answers
running in continuous mode
verifying command as well
keyword duration is 2 and duration is 3
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:51 --:--:--     0

if I manualy add !duration==2 and !com_dur==3 , it just continuously loops the 2 sec record and the output is this

Opening config file...
Not querying for answers
running in continuous mode
verifying command as well
keyword duration is 3 and duration is 2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 49768    0    14  100 49754      6  22003  0:00:02  0:00:02 --:--:-- 22015
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 51299    0    14  100 51285      6  22834  0:00:02  0:00:02 --:--:-- 22833
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 57216    0    14  100 57202      6  25583  0:00:02  0:00:02 --:--:-- 25582
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 51893    0    14  100 51879      6  23065  0:00:02  0:00:02 --:--:-- 23077
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 57787    0    14  100 57773      6  25724  0:00:02  0:00:02 --:--:-- 25734
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 48332    0    14  100 48318      6  21689  0:00:02  0:00:02 --:--:-- 21696
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 57886    0    14  100 57872      6  25678  0:00:02  0:00:02 --:--:-- 25686
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 61107    0    14  100 61093      6  27152  0:00:02  0:00:02 --:--:-- 27164

I'm stumbeling in the dark about this one, so any help would be much aprechiated. Thanks!

symatix commented 7 years ago

I have found a workaround. Installed amixer-webui to control the mic from the web ui, set !verify=0 !continuous==1 so now it will begin to record only when i enable the mic. This is even better solution for privacy because it does not send audio stream to google in an effort to recognize the keyword while I'm talking in the house. Now to go and code a one button solution for that, and I'm good to go :)

But I would still like to know the answer to my original post, as it was a problem that I spent hours before giving up.

awaisahmed119 commented 6 years ago

Im having the same issue. If someone know the solution then plz post it here.

awaisahmed119 commented 6 years ago

@symatix did you find the solution for this problem?