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

error while streaming or after stop recording POST https://api.openai.com/v1/audio/transcriptions 401 #48

Open
alihinnawe opened this issue Sep 7, 2023 · 2 comments

Comments

@alihinnawe
Copy link

alihinnawe commented Sep 7, 2023

Hi, iam running a 401 error while iam speaking:
I am using REACT Nextjs.
xhr.js:251 POST https://api.openai.com/v1/audio/transcriptions 401
dispatchXhrRequest @ xhr.js:251
xhr @ xhr.js:49
dispatchRequest @ dispatchRequest.js:51
request @ Axios.js:146
httpMethod @ Axios.js:185
wrap @ bind.js:5
eval @ chunk-32KRFHOA.js:5
await in eval (async)
eval @ chunk-YORICPLC.js:1
Z @ chunk-32KRFHOA.js:5
await in Z (async)
eval @ RecordRTC.js:3201
webWorker.onmessage @ RecordRTC.js:2810
client.js:1 useMemo AxiosError {message: 'Request failed with status code 401', name: 'AxiosError', code: 'ERR_BAD_REQUEST', config: {…}, request: XMLHttpRequest, …}

the status of transcribing was true when i was recording but producing this error

The code iam using is the same as you provided exept my API token
Any suggestions and help please?

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

const LiveWhisper = () => {
const {
recording,
speaking,
transcribing,
transcript,
pauseRecording,
startRecording,
stopRecording,
} = useWhisper({
apiKey: process.env.NEXT_PUBLIC_OPENAI_API_TOKEN, // YOUR_OPEN_AI_TOKEN
streaming: true,
timeSlice: 1_000, // 1 second
whisperConfig: {
language: "en",
},
});
console.log(
``

return (


Recording: {recording}


Speaking: {speaking}


Transcribing: {transcribing}


Transcribed Text: {transcript.text}


<button onClick={() => startRecording()}>Start
<button onClick={() => pauseRecording()}>Pause
<button onClick={() => stopRecording()}>Stop

);
};

export default LiveWhisper;
`

@SinazoBogicevic
Copy link

Hey @alihinnawe did you ever solve this issue?

@alihinnawe
Copy link
Author

@SinazoBogicevic no i used react speech to text library installed

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

2 participants