Breaking Change
Add an extra optional attribute** to the ForceEndOfUtterance message to help the engine know the real-world time marker for when the forced end of utterance should be considered. It should only be used with transcribers that support this extended message.
{"message": "ForceEndOfUtterance", "timestamp": 1.23}
Using the client.audio_seconds_sent property will return the number of seconds of audio that have been sent to the transcriber, calculated using encoding format and sample rate of the session's audio (AudioFormat). This can then be used when calling the force end of utterance:
client.force_end_of_utterance(timestamp=client.audio_seconds_sent)
Transcribers that don't support the new timestamp parameter will return an error:
Unable to validate message against the API JSON schema: ["<ValidationError: '.: {'message': 'ForceEndOfUtterance', 'timestamp': 1.87} is not valid under any of the given schemas'>"]
It can be disabled by passing in the function timestamp=None as such:
client.force_end_of_utterance(timestamp=None)
New Contributors
- @giorgosHadji made their first contribution in #95