loading
 
Listen to noise
Marco Tricca from United States  [2 posts]
8 year
HI, I am making a home automation robot.
I need to set up a noise level detection. I am trying to use "Listen" command but it will listen just to words.
How I do this?
I am using kinect 360 array mics to detect any noise it would be in the room and the kinect 360 with "movement" to detect movements.
Anyways after the detection I am using an IF statement that reads "movement percent" to  make "speak" the robot.
after this action I need a "WAIT FOR" to wait for my voice command.
How do I achieve the wait for?
otherwise every movement triggers the "speak" so I can't talk to give the command.
Hope I have been clear.
Thanks

program.robo
Steven Gentner from United States  [1446 posts] 8 year
Marco,

After speaking you need to set a variable that will avoid the speaking again until something has been heard. Ie.

if spoken <> 1 then
  Speak
  SetVariable spoken=1
else
  Listen
  if textHeard <> "" then
    SetVariable spoken=0
  end if
end if

or use something like a status variable that will move you through steps.

if status = 1 then
  Speak
  Set_Variable status = 2
end if

if status = 2 then
  Listen
  if textHeard <> ""
    Set_Variable status = 3
  end if
end if

if status = 3 then
  process heard commands or reset to speak again
end if

etc.

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index