Skip to content

unable to use startTranscription #1

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

Open
sarkarDeep223 opened this issue Dec 16, 2024 · 1 comment
Open

unable to use startTranscription #1

sarkarDeep223 opened this issue Dec 16, 2024 · 1 comment

Comments

@sarkarDeep223
Copy link

sarkarDeep223 commented Dec 16, 2024

const { startTranscription, stopTranscription } = useTranscription({
onTranscriptionStateChanged: (status) => {},
onTranscriptionText: (data) => {
const { text } = data;
setTranscriptionText(text);
},
});

const {
TRANSCRIPTION_STARTED,
TRANSCRIPTION_STARTING,
TRANSCRIPTION_STOPPED,
// TRANSCRIPTION_STOPPING,
} = Constants.transcriptionEvents;

const transscriptStart =()=>{
console.log("transscriptStart",transcriptionState);
if(transcriptionState === TRANSCRIPTION_STOPPED){
startTranscription();
}

}

TypeError: Cannot read properties of null (reading 'startTranscription')

@sosumit001
Copy link
Collaborator

sosumit001 commented Dec 16, 2024

can you share code for this entire component, because there are few things which are not clear, if you are using useTranscription hook outside the component than you'll get this kind of error

make sure it is formatted like this -

const MyComponent = () => {

     const { startTranscription, stopTranscription } = useTranscription({
     onTranscriptionStateChanged: (status) => {},
     onTranscriptionText: (data) => {
         const { text } = data;
        setTranscriptionText(text);
       },
    });

         // rest of your code

      return (...)
}

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