Hi @Harish A ,
Thank you for using the Microsoft Q&A.
I can understand that you were looking for a method that can allow the maximum duration of silence, before the conversation is considered complete. I will be happy to assist you with this.
You can use the speech_config.set_service_property()
method to set any one of the below 2 parameters:
conversationEndSilenceTimeoutMs
(OR)
Speech_SegmentationSilenceTimeoutMs
By setting any one of these 2 properties, you can handle silence and avoid the "session stop" event from getting triggered. Then the code can handle the conversation ending detection timeout.
# Set conversation ending detection timeout (4 hours in seconds)
conversation_ending_detection_timeout = 4 * 60 * 60
speech_config.set_service_property("conversationEndSilenceTimeoutMs", str(conversation_ending_detection_timeout * 1000), speechsdk.ServicePropertyChannel.UriQueryParameter)
(OR)
# Set conversation ending detection timeout (4 hours in seconds) conversation_ending_detection_timeout = 4 * 60 * 60
speech_config.set_service_property("speechsdk.PropertyId.Speech_SegmentationSilenceTimeoutMs", str(conversation_ending_detection_timeout * 1000), speechsdk.ServicePropertyChannel.UriQueryParameter)
Here is the link, where you can find more details.
How to recognize speech - Speech service - Azure AI services | Microsoft Learn
Hope this helps.
Thank you!
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.