I dont understand what you want to do with this directly but I suppose you want to stop recording when NAO Detects that the speaking person has finished speaking.
Maybe you could use this memory event that tells you when someone is not speaking anymore:
I am working on the Nao V6 robot. I wonder how to make customized audio recordings to record it in dynamic time without a set fixed time sleep. Hope ALDEBARAN community can help me on this. Thank you in advance