Skip to main content

End of Turn Detection

Transcription:Real-TimeDeployments:All

To improve user experience in responsive real-time scenarios it important to know when a person has finished speaking. This is especially important for voice AI, translation, and dictation use cases. Detecting an 'End of Turn' can be used to trigger actions such as generating a response in a Voice AI agent.

To get started, check out the Configuration Example below.

Use Cases

Voice AI & Conversational Systems: Enable voice assistants and chatbots to detect when the user has finished speaking, allowing the system to respond promptly without awkward delays.

Real-time Translation: Critical for live interpretation services where translations need to be delivered as soon as the speaker completes their thought, maintaining the flow of conversation.

Dictation & Transcription: Helps dictation software determine when users have completed their input, improving speed of final transcription and user experience.

End of Utterance Configuration

Speechmatics' Speech-To-Text allows you to use a period of silence to determine when a user has finished speaking. This is known as End of Utterance detection and is one way to detect End of Turn.

To enable End of Utterance detection, include the following in the StartRecognition message:

{
  "type": "transcription",
  "transcription_config": {
    "conversation_config": {
        "end_of_utterance_silence_trigger": 0.5
    },
    "language": "en",
  }
}
  • end_of_utterance_silence_trigger (Number): Allowed between 0 and 2 seconds. Setting to 0 seconds disables detection. This is the number of seconds of non-speech (silence) to wait before an End of Utterance is identified. When this happens, speechmatics will send a Final transcript message, followed by an extra EndOfUtterance message

Notes

  • We recommend 0.5-0.8 seconds for most voice AI applications. Longer values (0.8-1.2s) may be better for dictation applications.
  • Keep the end_of_utterance_silence_trigger lower than the max_delay value.
  • EndOfUtterance messages are only sent after some speech is recognised and duplicate EndOfUtterance messages will never be sent for the same period of silence.
  • The EndOfUtterance message is not related to any specific individual identified by Diarization and will not contain speaker information.

Example End of Utterance Message

{
  "message": "EndOfUtterance",
  "format": "2.9",
  "metadata": {
    "start_time": 1.07,
    "end_time": 1.07
  }
}

Semantic End of Turn

While silence-based End of Utterance is enough for many use cases, it is often improved by combining it with the context of the conversation. This is known as 'Semantic End of Turn Detection'. You can try Semantic End of Turn right away with our free Flow service demo!

Semantic End of Turn comes already included in Flow to provide the best experience for your users. You can also check out our Semantic End-of-Turn detection "how to" guide for more details on how to implement this in your own application.

Code Examples

Copy in your API key and file name to get started.

pip3 install speechmatics-python
speechmatics config set --auth-token $API_KEY
speechmatics rt transcribe example.wav \
  --operating-point enhanced \
  --enable-partials \
  --max-delay 1 \
  --end-of-utterance-silence-trigger 0.75