Virbe Documentation

On Language Change

Fires when STT detects a different spoken language – accept or reject the switch here.

The On Language Change handler fires when the Speech-to-Text engine detects that the user is speaking or typing in a language different from the current active language. This handler lets you decide whether to accept the switch, reject it, or apply custom logic before committing the change.

When It Runs

This handler runs before the language change takes effect. The new language has been detected but not yet applied – the current active language is still in use. Your handler decides what to do with the pending change.

This handler is triggered by the conversation language change signal, which fires automatically when STT detects a different language.

Common Uses

  • Accept all language changes – Let the virtual being switch languages freely as the user changes language
  • Notify the flow – Accept the change and then trigger a flow that acknowledges the switch to the user

Typical Node Pattern

On Language Change ──► Accept Language Change ──► Continue Processing

Or with a language filter:

On Language Change
    │
    ├── On Stt detection ──► If/Else Router (language equals = x) ──► Accept Language Change / Reject Language Change ──► Continue Processing
    │
    └── On Signal ──► Reject Language Change ──► Continue Processing

The entry node for this handler exposes two branches:

  • On Stt detection (language detection from STT) – use this for normal speech-based language changes
  • On Signal – fires when the change was triggered programmatically via a signal

Available Nodes

NodeCategoryPurpose
Accept Language ChangeLanguageCommits the pending language change – the virtual being switches to the new language
Reject Language ChangeLanguageDiscards the pending change – the virtual being stays in the current language
Continue ProcessingExitPasses control back to Conversational Flows after the language decision
Abandon ProcessingExitDrops processing entirely
Check VariableContextRead a variable before deciding
Route by ProfileLogicBranch by touchpoint
Route by LanguageLogicBranch by the detected (pending) language
Route by SignalLogicBranch by a named signal
If/Else RouterLogicBranch by various conditions
Intent MatcherLogicLLM-powered routing
Is Flow ActiveLogicCheck if a flow is currently running
CommentOtherCanvas annotation

Example: Accept Then Acknowledge

Accept every language change and then let a flow tell the user that the language has been switched:

  1. On Language Change entry
  2. Accept Language Change – commits the new language
  3. Continue Processing – hands off to Conversational Flows, which can check the new language and respond in it

Always connect Accept Language Change or Reject Language Change before Continue Processing. If you reach Continue Processing without explicitly accepting or rejecting, the behavior is undefined.

Language Compatibility

For language switching to work end-to-end, the detected language must be:

  1. Configured as an STT engine that supports it (under Configurations → Speech-to-Text)
  2. Added to the Persona's voice list (under Personas → Voices)

If the language is not set up in both places, accepting the change will not result in speech in the new language.

On this page