Discussions

Ask a Question
Back to all

Avatar doesn't stop talking

I am implementing the avatar using the react sdk and I cannot get it to register that it's being interrupted while talking. I have tried to add in the stop functionality given in the documentation as such,

            avatarRef.current.on(StreamingEvents.AVATAR_STOP_TALKING, (e) => {
                console.log("Avatar stopped talking");
                dispatch(stopSpeaking()); //tells the avatar to stop
                dispatch(setAvatarScript('')); //clear out the speaking data
            });

and I cannot get it to work this way either:

    //stop the avatar from speaking
    const handleStopClick = () => {
        console.log("avatar stopped");
        avatarRef.current.stopAvatar();
    };