funlistenExtended(timeout:Int,rounds:Int):State=state{varsilenceCount=0valresponses=mutableListOf<Response<*>>()onEntry{if(silenceCount<rounds){furhat.listen(timeout=timeout)}else{terminate(responses)}}onResponse{// Could do a feedback token here, if voice has onesilenceCount=0responses.add(it)reentry()}onNoResponse{silenceCount++reentry()}}
valresponses=call(listenExtended(8000,2))asMutableList<Response<*>>if(responses.isEmpty()){furhat.say("You said nothing")}else{furhat.say("you said")responses.forEach{furhat.say(it.text)}}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.