Skip to content

Speech Barge In Options

 REST API Version 2.0 only.

Defines the language and specific words or short phrases that may barge in on a play action.

Used by actions play

language wrappers and examples

It has the following properties:

PropertyRequired/OptionalDefaultDescription
languageoptionalen-USA BCP 47 language code for the barge in phrases. Use a language code from the Speech Recognition Languages page.
barge in phrasesoptional-An array of strings each containing a word or short phrase that may be spoken to barge in.
speech model optionsoptional-A speech model options object to select and configure the model used.

Examples:

Set the language and some barge in phrases:
{
    "language" : "en-GB",
    "barge_in_phrases" :
    [
        "cancel",
        "stop",
    ]
}

SpeechBargeInOptions Class

Namespace: Aculab.Cloud.RestAPIWrapper

Assembly: Aculab.Cloud.RestAPIWrapper.dll

A class representing the options for speech input during a play action.

public class SpeechBargeInOptions 
{
    // Constructors
    public SpeechBargeInOptions(string language = null);

    // Members
    public string Language;
    public List<string> BargeInPhrases;
    public bool ShouldSerializeBargeInPhrases();
    public SpeechModelOptions SpeechModelOptions;
}

Examples:

Set the language and some barge in phrases:
var speechBargeInOptions = new SpeechBargeInOptions("en-GB")
{
BargeInPhrases = { "cancel", "stop" }
};

var playAction = Play.SayText("Welcome");
playAction.BargeInOnSpeechOptions = speechBargeInOptions;
public class SpeechBargeInOptions 
{
    // Constructors
    public SpeechBargeInOptions(string language = null);

    // Members
    public string Language;
    public List<string> BargeInPhrases;
    public bool ShouldSerializeBargeInPhrases();
    public SpeechModelOptions SpeechModelOptions;
}

Examples:

Set the language and some barge in phrases:
var speechBargeInOptions = new SpeechBargeInOptions("en-GB")
{
BargeInPhrases = { "cancel", "stop" }
};

var playAction = Play.SayText("Welcome");
playAction.BargeInOnSpeechOptions = speechBargeInOptions;
public class SpeechBargeInOptions 
{
    // Constructors
    public SpeechBargeInOptions(string language = null);

    // Members
    public string Language;
    public List<string> BargeInPhrases;
    public bool ShouldSerializeBargeInPhrases();
    public SpeechModelOptions SpeechModelOptions;
}

Examples:

Set the language and some barge in phrases:
var speechBargeInOptions = new SpeechBargeInOptions("en-GB")
{
BargeInPhrases = { "cancel", "stop" }
};

var playAction = Play.SayText("Welcome");
playAction.BargeInOnSpeechOptions = speechBargeInOptions;

SpeechBargeInOptions Class

Namespace: Aculab.Cloud.RestAPIWrapper

Assembly: Aculab.Cloud.RestAPIWrapper.dll

A class representing the options for speech input during a play action.

Public Class SpeechBargeInOptions
    ' Constructors
    Public Sub New (Optional language As String = Nothing)

    ' Members
    Public Property Language As String
    Public Property BargeInPhrases As List(Of String)
    Public Function ShouldSerializeBargeInPhrases() As Bool
    Public Property SpeechModelOptions As Speechmodeloptions
End Class

Examples:

Set the language and some barge in phrases:
Dim speechBargeInOptions = New SpeechBargeInOptions("en-GB")
speechBargeInOptions.BargeInPhrases.Add("cancel")
speechBargeInOptions.BargeInPhrases.Add("stop")

Dim playAction = Play.SayText("Welcome")
playAction.BargeInOnSpeechOptions = speechBargeInOptions
Public Class SpeechBargeInOptions
    ' Constructors
    Public Sub New (Optional language As String = Nothing)

    ' Members
    Public Property Language As String
    Public Property BargeInPhrases As List(Of String)
    Public Function ShouldSerializeBargeInPhrases() As Bool
    Public Property SpeechModelOptions As Speechmodeloptions
End Class

Examples:

Set the language and some barge in phrases:
Dim speechBargeInOptions = New SpeechBargeInOptions("en-GB")
speechBargeInOptions.BargeInPhrases.Add("cancel")
speechBargeInOptions.BargeInPhrases.Add("stop")

Dim playAction = Play.SayText("Welcome")
playAction.BargeInOnSpeechOptions = speechBargeInOptions

class SpeechBargeInOptions extends JSONElement

Represents the Speech Barge In Options support class.

Class synopsis:

// Constructors:
public SpeechBargeInOptions()

// Members:
public void setLanguage(String language)
public void setBargeInPhrases(List<String> phrases)
public void setSpeechModelOptions(SpeechModelOptions speechModelOptions)

Examples:

Set the language and some barge in phrases:
List<String> barge_in_phrases = new ArrayList<>();
barge_in_phrases.add("cancel");
barge_in_phrases.add("stop");

SpeechBargeInOptions options = new SpeechBargeInOptions();
options.setLanguage("en-GB");
options.setBargeInPhrases(barge_in_phrases);

class SpeechBargeInOptions

Represents the Speech Barge In Options support class.

Class synopsis:

# SpeechBargeInOptions object:
SpeechBargeInOptions()

# Instance methods:
SpeechBargeInOptions.set_language(language)
SpeechBargeInOptions.set_barge_in_phrases(list_of_phrases)
SpeechBargeInOptions.set_speech_model_options(speech_model_options)

Examples:

Set the language and some barge in phrases:
speech_barge_in_opts = SpeechBargeInOptions()
speech_barge_in_opts.set_language("en-GB")
speech_barge_in_opts.set_barge_in_phrases(["cancel","stop"])

The SpeechBargeInOptions class

Introduction

Represents speech barge in options.

Class synopsis

class SpeechBargeInOptions {

    /* methods */
    public __construct()
    public self setLanguage(string $lang)
    public self setBargeInPhrases(array $phrases)
    public self setSpeechModelOptions(SpeechModelOptions $opts)
}

Examples:

Set the language and some barge in phrases
$speech_barge_in_options = new \Aculab\TelephonyRestAPI\SpeechBargeInOptions();
$speech_barge_in_options->setLanguage("en-GB")
    ->setBargeInPhrases(["cancel", "stop"]);