Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onFrameProcessed not firing #144

Open
jfbourne opened this issue Oct 11, 2024 · 3 comments
Open

onFrameProcessed not firing #144

jfbourne opened this issue Oct 11, 2024 · 3 comments

Comments

@jfbourne
Copy link

jfbourne commented Oct 11, 2024

I was able to get VAD running in a nextjs application. However, I noticed that the onFrameProcessed is not firing at all. I have some console logs and its not printing.

const vad = useMicVAD({
    startOnLoad: false,
    onFrameProcessed: (probabilities) => {
      console.log("Prob...: ", probabilities);
    },
    onSpeechEnd: (audio) => {
      console.log("onSpeechEnd");
      const wavBuffer = utils.encodeWAV(audio);
      const base64 = utils.arrayBufferToBase64(wavBuffer);
      const url = `data:audio/wav;base64,${base64}`;
      setAudioList((old) => {
        return [url, ...old];
      });
    },
    onSpeechStart: () => {
      console.log("Speech start detected");
    },
  });
@ricky0123
Copy link
Owner

Hi @jfbourne that is odd, and the other callbacks are firing correctly?

@jfbourne
Copy link
Author

jfbourne commented Dec 2, 2024

That is correct. No issues with the other callbacks.

@ryanleeallred
Copy link

ryanleeallred commented Dec 5, 2024

I'm experiencing a similar issue in a plain React app with vad-react. All of the callbacks are working except for onFrameProcessed(). I haven't been able to make it fire at any point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants