chengsokdara / use-whisper

React hook for OpenAI Whisper with speech recorder, real-time transcription, and silence removal built-in
MIT License
735 stars 139 forks source link

Calling onTranscribe as soon as a speaker stops talking #15

Open kac487 opened 1 year ago

kac487 commented 1 year ago

Hi @chengsokdara, I'm loving this project, and I especially like the custom server functionality.

I am working on a project where I am recording multiple speakers talking in turns. My hope is to use useWhisper to transcribe the entire conversation, but I'd like to do so one piece at a time.

I was wondering if there is a way to configure useWhisper to trigger an on onTranscribe event when a speaker stops talking for a brief period (basically when the speaker variable goes from true to false) and then reset the audio file to set up for recording the next speaking block.

I saw your examples using the customizable callback functions but I wasn't sure how to properly configure them for this case.

Thanks, Kyle