Discussions

Ask a Question
Back to All

Using Interactive Avatar NextJS Demo and get the text the user says

I am studying this script before going further.
I'm not very used to coding in react, but everything seem to be clear, except one point.
How can I retrieve the string which contains the text spoken by the user?

avatar.current?.on(StreamingEvents.USER_START, (event) => {
  console.log(">>>>> User started talking:", event);
  setIsUserTalking(true);
});
avatar.current?.on(StreamingEvents.USER_STOP, (event) => {
  console.log(">>>>> User stopped talking:", event);
  setIsUserTalking(false);
});

Thanks,
Fred