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

Getting undefined in output for transcript #56

Open
ashwin-maurya opened this issue Apr 2, 2024 · 0 comments
Open

Getting undefined in output for transcript #56

ashwin-maurya opened this issue Apr 2, 2024 · 0 comments

Comments

@ashwin-maurya
Copy link

ashwin-maurya commented Apr 2, 2024

It is not giving any error though the output for trascript is
{blob: undefined, text: undefined}
Screenshot 2024-04-02 153201

I am using the very first example in the git repo.

`import React, { useState, useEffect } from 'react'
import { useWhisper } from '@chengsokdara/use-whisper'

export default function OpenAIDialog() {
    const {
        recording,
        speaking,
        transcribing,
        transcript,
        pauseRecording,
        startRecording,
        stopRecording,
    } = useWhisper({
        apiKey: 'Key', // YOUR_OPEN_AI_TOKEN
    })
    useEffect(() => {
        console.log('transcribing', transcribing)
        console.log('transcript', transcript)
        console.log('recording', recording)
        console.log('speaking', speaking)
    }, [recording, speaking, transcribing, transcript])
    return (
        <div>
            <p>Recording: {recording}</p>
            <p>Speaking: {speaking}</p>
            <p>Transcribing: {transcribing}</p>
            <p>Transcribed Text: {transcript.text}</p>
            <button onClick={() => startRecording()}>Start</button>
            <button onClick={() => pauseRecording()}>Pause</button>
            <button onClick={() => stopRecording()}>Stop</button>
        </div>
    )
}
`
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

1 participant