#Utternace End
1 messages · Page 1 of 1 (latest)
Hi @pastel gorge. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
The minimum recommended value for the utterance_end_ms parameter in Deepgram is 1000 milliseconds (1 second). This is because Deepgram's Interim Results, which the UtteranceEnd feature relies on, are typically sent every second. Therefore, using a value of less than 1000ms for utterance_end_ms will not offer any benefits.
However, it's important to note that if you try to set an utterance_end_ms value less than 1000ms, you might encounter an error like "Could not open socket: server rejected WebSocket connection: HTTP 400".
Here is an example of how to set the utterance_end_ms parameter in Python:
# see <https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/streaming/async_microphone/main.py>
# for complete example code
options: LiveOptions = LiveOptions(
model="nova-2",
language="en-US",
# Apply smart formatting to the output
smart_format=True,
# Raw audio format details
encoding="linear16",
channels=1,
sample_rate=16000,
# To get UtteranceEnd, the following must be set:
interim_results=True,
utterance_end_ms="1000",
vad_events=True,
# Time in milliseconds of silence to wait for before finalizing speech
endpointing=300
)