Skip to content

Speak function calls continously on onEnd #68

@naonvl

Description

@naonvl

I'm calling the speak function on onEnd function from useSpeechRecognition like this

  const onEnd = () => {
    fetch(
      "http://api/Main?id=test&lang=kor&req=" +
        value,
      {}
    )
      .then((res) => res.json())
      .then(
        (result) => {
          setResponse(result.res);
          speak({
            text: result.res,
            voices: {
              lang: "ko-KR",
            },
          });
          console.log(result);
        },
        (error) => {
          console.log(error);
        }
      );
  };

but the voice language doesn't changed to korean, also it speak continously. where did i do wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions