mirror of
https://github.com/jambonz/freeswitch-modules.git
synced 2025-12-18 22:27:43 +00:00
https://github.com/jambonz/jambonz-feature-server/issues/856 Signed-off-by: rammohan-kore <rammohan.yadavalli@kore.com>
mod_deepgram_transcribe
A Freeswitch module that generates real-time transcriptions on a Freeswitch channel by using Deepgram's streaming transcription API
API
Commands
The freeswitch module exposes the following API commands:
uuid_deepgram_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 AWS language code that is supported for streaming transcriptioninterim- If the 'interim' keyword is present then both interim and final transcription results will be returned; otherwise only final transcriptions will be returned
uuid_deepgram_transcribe <uuid> stop
Stop transcription on the channel.
Channel Variables
Events
deepgram_transcribe::transcription - returns an interim or final transcription. The event contains a JSON body describing the transcription result:
{
"channel_index": [0, 1],
"duration": 4.59,
"start": 0.0,
"is_final": true,
"speech_final": true,
"channel": {
"alternatives": [{
"transcript": "hello hello hello",
"confidence": 0.98583984,
"words": [{
"word": "hello",
"start": 3.0865219,
"end": 3.206,
"confidence": 0.99902344
}, {
"word": "hello",
"start": 3.5644348,
"end": 3.644087,
"confidence": 0.9741211
}, {
"word": "hello",
"start": 4.042348,
"end": 4.3609567,
"confidence": 0.98583984
}]
}]
},
"metadata": {
"request_id": "37835678-5d3b-4c77-910e-f8914c882cec",
"model_info": {
"name": "conversationalai",
"version": "2021-11-10.1",
"tier": "base"
},
"model_uuid": "6b28e919-8427-4f32-9847-492e2efd7daf"
}
}
Usage
When using drachtio-fsrmf, you can access this API command via the api method on the 'endpoint' object.
ep.api('uuid_deepgram_transcribe', `${ep.uuid} start en-US interim`);