call translation options
Available in REST API Version 2 and later.This controls how call audio is translated.
Its properties define the language that will be recognised, the language it is to be translated into, and the voice that is to be used to say the translated text. For most languages the translation options will be able to default its source language to that used by the speech recognition, and you will only need to specify the target translated language.
Used in class translator
language wrappers and examples
It contains the following properties:
Property | Required/Optional | Default | Description |
---|---|---|---|
speech recognition options | optional | - | A speech recognition options object to configure the speech recognition used. |
translation options | optional | - | A translation options object to configure the translation of the recognised speech. |
tts voice | optional | set in the service configuration | The TTS voice use to say the translated speech. Use a Selector from one of the voice tables on the Text-To-Speech (TTS) page. |
-
Examples:
-
Create a call translation options object with translation options:
{ "speech_recognition_options" : { "language" : "en-GB", "speech_model_options" : { "model": "latest_long" } }, "translation_options": { "source_language" : "en", # language of text generated by speech recognition "target_language" : "fr", # language to translate to for TTS }, "tts_voice" : "French France Female Polly Lea" }
-
Create a translation options object with implied translation options:
{ "speech_recognition_options" : { "language" : "fr-FR", "speech_model_options" : { "model" : "phone_call", "enhanced" : true } }, "tts_voice" : "English UK Female Polly Amy" }
-
-
CallTranslationOptions Class
Namespace: Aculab.Cloud.RestAPIWrapper
Assembly: Aculab.Cloud.RestAPIWrapper.dllA class representing the call translation recognition options that can be set when translating between two connected calls.
-
public class CallTranslationOptions { // Constructors public CallTranslationOptions(SpeechRecognitionOptions speechRecognitionOptions = null, TranslationOptions translationOptions = null, string ttsVoice = null); // Members public SpeechRecognitionOptions SpeechRecognitionOptions; public TranslationOptions TranslationOptions; public string TTSVoice; }
Examples:
-
Create a call translation options object specifying the translation options explicitly:
var callTranslationOptions = new CallTranslationOptions() { SpeechRecognitionOptions = new SpeechRecognitionOptions() { Language = "en-GB", SpeechModelOptions = new SpeechModelOptions() { Model = "latest_long" } }, TranslationOptions = new TranslationOptions() { SourceLanguage = "en", TargetLanguage = "fr" }, TTSVoice = "French France Female Polly Lea" };
-
Create a call translation options object with implied translation options:
var callTranslationOptions = new CallTranslationOptions() { SpeechRecognitionOptions = new SpeechRecognitionOptions() { Language = "fr-FR", SpeechModelOptions = new SpeechModelOptions() { Model = "phone_call", Enhanced = true } }, TTSVoice = "English UK Female Polly Amy" };
-
-
public class CallTranslationOptions { // Constructors public CallTranslationOptions(SpeechRecognitionOptions speechRecognitionOptions = null, TranslationOptions translationOptions = null, string ttsVoice = null); // Members public SpeechRecognitionOptions SpeechRecognitionOptions; public TranslationOptions TranslationOptions; public string TTSVoice; }
Examples:
-
Create a call translation options object specifying the translation options explicitly:
var callTranslationOptions = new CallTranslationOptions() { SpeechRecognitionOptions = new SpeechRecognitionOptions() { Language = "en-GB", SpeechModelOptions = new SpeechModelOptions() { Model = "latest_long" } }, TranslationOptions = new TranslationOptions() { SourceLanguage = "en", TargetLanguage = "fr" }, TTSVoice = "French France Female Polly Lea" };
-
Create a call translation options object with implied translation options:
var callTranslationOptions = new CallTranslationOptions() { SpeechRecognitionOptions = new SpeechRecognitionOptions() { Language = "fr-FR", SpeechModelOptions = new SpeechModelOptions() { Model = "phone_call", Enhanced = true } }, TTSVoice = "English UK Female Polly Amy" };
-
-
public class CallTranslationOptions { // Constructors public CallTranslationOptions(SpeechRecognitionOptions speechRecognitionOptions = null, TranslationOptions translationOptions = null, string ttsVoice = null); // Members public SpeechRecognitionOptions SpeechRecognitionOptions; public TranslationOptions TranslationOptions; public string TTSVoice; }
Examples:
-
Create a call translation options object specifying the translation options explicitly:
var callTranslationOptions = new CallTranslationOptions() { SpeechRecognitionOptions = new SpeechRecognitionOptions() { Language = "en-GB", SpeechModelOptions = new SpeechModelOptions() { Model = "latest_long" } }, TranslationOptions = new TranslationOptions() { SourceLanguage = "en", TargetLanguage = "fr" }, TTSVoice = "French France Female Polly Lea" };
-
Create a call translation options object with implied translation options:
var callTranslationOptions = new CallTranslationOptions() { SpeechRecognitionOptions = new SpeechRecognitionOptions() { Language = "fr-FR", SpeechModelOptions = new SpeechModelOptions() { Model = "phone_call", Enhanced = true } }, TTSVoice = "English UK Female Polly Amy" };
-
-
-
CallTranslationOptions Class
Namespace: Aculab.Cloud.RestAPIWrapper
Assembly: Aculab.Cloud.RestAPIWrapper.dllA class representing the call translation recognition options that can be set when translating between two connected calls.
-
Public Class CallTranslationOptions ' Constructors Public Sub New (Optional speechRecognitionOptions As Speechrecognitionoptions = Nothing, Optional translationOptions As Translationoptions = Nothing, Optional ttsVoice As String = Nothing) ' Members Public Property SpeechRecognitionOptions As Speechrecognitionoptions Public Property TranslationOptions As Translationoptions Public Property TTSVoice As String End Class
Examples:
-
Create a call translation options object specifying the translation options explicitly
Dim callTranslationOptions = New CallTranslationOptions() With { .SpeechRecognitionOptions = New SpeechRecognitionOptions() With { .Language = "en-GB", .SpeechModelOptions = New SpeechModelOptions(model:="latest_long") }, .TranslationOptions = New TranslationOptions() With { .SourceLanguage = "en", .TargetLanguage = "fr" }, .TTSVoice = "French France Female Polly Lea" }
-
Create a call translation options object with implied translation options
Dim callTranslationOptions = New CallTranslationOptions() With { .SpeechRecognitionOptions = New SpeechRecognitionOptions() With { .Language = "fr-FR", .SpeechModelOptions = New SpeechModelOptions() With { .Model = "phone_call", .Enhanced = True } }, .TTSVoice = "English UK Female Polly Amy" }
-
-
Public Class CallTranslationOptions ' Constructors Public Sub New (Optional speechRecognitionOptions As Speechrecognitionoptions = Nothing, Optional translationOptions As Translationoptions = Nothing, Optional ttsVoice As String = Nothing) ' Members Public Property SpeechRecognitionOptions As Speechrecognitionoptions Public Property TranslationOptions As Translationoptions Public Property TTSVoice As String End Class
Examples:
-
Create a call translation options object specifying the translation options explicitly
Dim callTranslationOptions = New CallTranslationOptions() With { .SpeechRecognitionOptions = New SpeechRecognitionOptions() With { .Language = "en-GB", .SpeechModelOptions = New SpeechModelOptions(model:="latest_long") }, .TranslationOptions = New TranslationOptions() With { .SourceLanguage = "en", .TargetLanguage = "fr" }, .TTSVoice = "French France Female Polly Lea" }
-
Create a call translation options object with implied translation options
Dim callTranslationOptions = New CallTranslationOptions() With { .SpeechRecognitionOptions = New SpeechRecognitionOptions() With { .Language = "fr-FR", .SpeechModelOptions = New SpeechModelOptions() With { .Model = "phone_call", .Enhanced = True } }, .TTSVoice = "English UK Female Polly Amy" }
-
-
-
class CallTranslationOptions extends JSONElement
Represents the Call Translation Options support class.
Class synopsis:
// Constructors: public CallTranslationOptions() // Members: public void setSpeechRecognitionOptions(SpeechRecognitionOptions options) public void setTranslationOptions(TranslationOptions options) public void setTTSVoice(String ttsVoice)
Examples:
-
Create a call translation options object with translation options:
SpeechModelOptions speechModelOpts = new SpeechModelOptions(); speechModelOpts.setModel("latest_long"); SpeechRecognitionOptions speechRecognitionOpts = new SpeechRecognitionOptions(); speechRecognitionOpts.setLanguage("en-GB"); speechRecognitionOpts.setSpeechModelOptions(speechModelOpts); TranslationOptions translationOpts = new TranslationOptions(); translationOpts.setSourceLanguage("en"); translationOpts.setTargetLanguage("fr"); CallTranslationOptions callTranslationOpts = new CallTranslationOptions(); callTranslationOpts.setSpeechRecognitionOptions(speechRecognitionOpts); callTranslationOpts.setTranslationOptions(translationOpts); callTranslationOpts.setTTSVoice("French France Female Polly Lea");
-
Create a call translation options object with implied translation options:
SpeechModelOptions speechModelOpts = new SpeechModelOptions(); speechModelOpts.setModel("phone_call"); speechModelOpts.setEnhanced(true); SpeechRecognitionOptions speechRecognitionOpts = new SpeechRecognitionOptions(); speechRecognitionOpts.setLanguage("fr-FR"); speechRecognitionOpts.setSpeechModelOptions(speechModelOpts); CallTranslationOptions callTranslationOpts = new CallTranslationOptions(); callTranslationOpts.setSpeechRecognitionOptions(speechRecognitionOpts); callTranslationOpts.setTTSVoice("English UK Female Polly Amy");
-
-
class CallTranslationOptions
Represents the Call Translation Options support class.
Class synopsis:
# CallTranslationOptions object: CallTranslationOptions() # Instance methods: CallTranslationOptions.set_speech_recognition_options(options) CallTranslationOptions.set_translation_options(options) CallTranslationOptions.set_tts_voice(voice)
Examples:
-
Create a call translation options object with translation options:
speechModelOpts = SpeechModelOptions() speechModelOpts.set_model("latest_long") speechRecognitionOpts = SpeechRecognitionOptions() speechRecognitionOpts.set_language("en-GB") speechRecognitionOpts.set_speech_model_options(speechModelOpts) translationOpts = TranslationOptions() translationOpts.set_source_language("en") translationOpts.set_target_language("fr") callTranslationOpts = CallTranslationOptions() callTranslationOpts.set_speech_recognition_options(speechRecognitionOpts) callTranslationOpts.set_translation_options(translationOpts) callTranslationOpts.set_tts_voice("French France Female Polly Lea")
-
Create a call translation options object with implied translation options:
speechModelOpts = SpeechModelOptions() speechModelOpts.set_model("phone_call") speechModelOpts.set_enhanced(True) speechRecognitionOpts = SpeechRecognitionOptions() speechRecognitionOpts.set_language("fr-FR") speechRecognitionOpts.set_speech_model_options(speechModelOpts) callTranslationOpts = CallTranslationOptions() callTranslationOpts.set_speech_recognition_options(speechRecognitionOpts) callTranslationOpts.set_tts_voice("English UK Female Polly Amy")
-
-
The CallTranslationOptions class
Introduction
Represents the call translation options.
Class synopsis
class CallTranslationOptions { /* methods */ public __construct() public self setSpeechRecognitionOptions(SpeechRecognitionOptions $opts) public self setTranslationOptions(TranslationOptions $opts) public self setTTSVoice(string $tts_voice) }
Examples:
Create a call translation options object with translation options:
$call_translation_options = new Aculab\TelephonyRestAPI\CallTranslationOptions(); $speech_model_options = new \Aculab\TelephonyRestAPI\SpeechModelOptions(); $speech_model_options->setModel("latest_long"); $speech_recognition_options = new \Aculab\TelephonyRestAPI\SpeechRecognitionOptions(); $speech_recognition_options->setLanguage("en-GB"); $speech_recognition_options->setSpeechModelOptions($speech_model_options); $call_translation_options->setSpeechRecognitionOptions($speech_recognition_options); $translation_options = new Aculab\TelephonyRestAPI\TranslationOptions(); $translation_options->setSourceLanguage('en') ->setTargetLanguage('fr'); $call_translation_options->setTranslationOptions($translation_options); $call_translation_options->setTTSVoice("French France Female Polly Lea");
Create a translation options object with implied translation options:
$call_translation_options = new Aculab\TelephonyRestAPI\CallTranslationOptions(); $speech_model_options = new \Aculab\TelephonyRestAPI\SpeechModelOptions(); $speech_model_options->setModel("phone_call") ->setEnhanced(true); $speech_recognition_options = new \Aculab\TelephonyRestAPI\SpeechRecognitionOptions(); $speech_recognition_options->setLanguage("fr-FR"); $speech_recognition_options->setSpeechModelOptions($speech_model_options); $call_translation_options->setSpeechRecognitionOptions($speech_recognition_options); $call_translation_options->setTTSVoice("English UK Female Polly Amy");