Captions only and captions with translation API
You can enable captions only or captions with translation modes by adjusting the task options.
Depending on your input_stream setting, use WebSockets or WebRTC DataChannel to receive caption messages.
Follow the general API connection flow, which is described here.
Refer to the recommended settings to set exact option values in the examples below.
Captions only
To enable this mode, set output_stream to null and translations to an empty list.
All input_stream and transcription options are supported.
See the example set_task command structure below:
{
"input_stream": {/*...*/},
"output_stream": null, // set to `null`
"pipeline": {
"transcription": {/*...*/},
"translations": [], // set to an empty list
"allowed_message_types": [
// you will only receive messages of these types
"partial_transcription",
"validated_transcription"
]
}
}
Captions with translation
To enable this mode, set output_stream to null and omit or set to null speech_generation in translation settings.
All standard task options are supported — see the recommended settings.
See the example set_task command structure below:
{
"input_stream": {/*...*/},
"output_stream": null, // set to `null`
"pipeline": {
"transcription": {/*...*/},
"translations": [{/*...*/}, {/*...*/}], // translation settings for each language, set `speech_generation` to null
"allowed_message_types": [
// you will only receive messages of these types
"partial_transcription",
"validated_transcription",
"translated_transcription"
]
}
}
Multiple target languages
If multiple target languages are set in translations you will receive a separate translated_transcription for each one.