A Freeswitch module that generates real-time transcriptions on a Freeswitch channel by using Google's Speech-to-Text API.
The freeswitch module exposes the following API commands:
uuid_google_transcribe <uuid> start <lang-code> [interim]
Attaches media bug to channel and performs streaming recognize request.
uuid
- unique identifier of Freeswitch channellang-code
- a valid Google language code to use for speech recognitioninterim
- If the 'interim' keyword is present then both interim and final transcription results will be returned; otherwise only final transcriptions will be returned
uuid_google_transcribe <uuid> stop
Stop transcription on the channel.
google_transcribe::transcription
- returns an interim or final transcription. The event contains a JSON body describing the transcription result:
{
"stability": 0,
"is_final": true,
"alternatives": [{
"confidence": 0.96471,
"transcript": "Donny was a good bowler, and a good man"
}]
}
When using drachtio-fsrmf, you can access this API command via the api method on the 'endpoint' object.
ep.api('uuid_google_transcribe', `${ep.uuid} start en-US`);