chengsokdara / use-whisper

React hook for OpenAI Whisper with speech recorder, real-time transcription, and silence removal built-in

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

It does not seem to work for any reason

debugger-anubhav opened this issue · comments

Hi @chengsokdara

The package does not seem to work for me for no apparent reason. I added a bunch of extra packages like @ffmpeg/ffmpeg, hark, openai, and recordrtc just to be absolutely sure.

I have a pretty simple setup just for demo purpose and when I start recording I do get the following logs in the console
Screenshot 2023-04-11 at 11 40 48 AM

These do suggest that everything seems to be working fine but when I log the transcript, I always get the following => {blob: undefined, text: undefined} as the output.

My recording status is also true when I am speaking but for some reason the output blob and text is always undefined.

My env:

  1. Mac M1
  2. CRA
  3. React 17.0.2
  4. use-whisper 0.2.0

Following is a snippet of what I have done:

import React from "react";
import {useWhisper} from "@chengsokdara/use-whisper";

const App: React.FC = () => {

  const {startRecording, stopRecording, transcript, recording} = useWhisper({
    apiKey: key,
  });
  console.log("transcript", transcript);
  console.log("recording", recording);
  console.log("...........");

  return (
    <>
      <button onClick={() => startRecording()}>start</button>
    </>
  );
};

export default App;

Thanks in advance
Cheers

same for me