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

Severe bug: uploading lots of audio produces HEAVY openai costs

skamensky opened this issue · comments

Issue

In 5 minutes useWhisper sent 100's of requests, uploaded 74684 seconds of audio which is over 20 hours, and cost over $17!

It looks like you're uploading the entire cumulative recording every second?

Luckily I had billing limits set.

Config

const {
  recording,
  speaking,
  transcribing,
  transcript,
  pauseRecording,
  startRecording,
  stopRecording,
} = useWhisper({
  apiKey:  getApiKey() ,
  streaming: true,
  timeSlice: 1_000, // 1 second
  whisperConfig: {
    language: 'he',
  },
});

Proof

image

Is this still the case? Did anyone find a workaround/fix?

Same problem, this library will eat up credits. Should be fixed real quick.

I guess its because of streaming=true and its not a lib bug but the idea of how It work