How to increase the time of silence of the dictation before it automatically ends the sentence with a period

Vinicio Ajuchan 6 Reputation points
2021-07-15T17:00:08.977+00:00

I'm using the c# Microsoft.CognitiveServices.Speech package to process speech to text, it works, but I'm facing an issue related to how the service recognizes the speech and translates it to text, for example, one of our users reports the following:

As a user, I want to be able to use the speech to text feature with the opportunity to pause without the sentence ending automatically with a period. Currently, my dictation appears as the following:

My dictation. Looks like this.

When I hesitate between "my dictation" and "looks like this" for a certain time it immediately ends the sentence and adds a period.

The dictation mode is enabled, so the config sets the EnableDictation(), I also set some properties based on github discussion https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/131, but I did not have luck, the same thing happens.

This is the code I'm using, as the Dictation Mode is enabled then it uses the StartContinuousRecognitionAsync method.

  var config =
                SpeechConfig.FromSubscription(this.SpeechRecognitionInitializer.AzureSubscriptionKey,
                                              this.SpeechRecognitionInitializer.AzureRegion);

                if (this.SpeechRecognitionInitializer.EnableDictationMode)
                {
                    config.EnableDictation();
                }

                config.SetProfanity(ProfanityOption.Raw);
                config.SetProperty(PropertyId.Conversation_Initial_Silence_Timeout, "15000");
                config.SetProperty(PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs, "15000");
                config.SetProperty(PropertyId.SpeechServiceConnection_EndSilenceTimeoutMs, "15000");
                stopRecognition = new TaskCompletionSource<int>();

                using (AudioConfig audioConfig = AudioConfig.FromDefaultMicrophoneInput())
                {
                    using (recognizer = new SpeechRecognizer(config, audioConfig))
                    {
                        recognizer.Recognizing += Recognizer_Recognizing;
                        recognizer.Recognized += Recognizer_Recognized;
                        recognizer.Canceled += Recognizer_Canceled;
                        recognizer.SessionStopped += Recognizer_SessionStopped;
                        if (this.SpeechRecognitionInitializer.EnableDictationMode)
                        {
                            await recognizer.StartContinuousRecognitionAsync().ConfigureAwait(false);
                            await Task.WhenAll(new[] { stopRecognition.Task }); // Waiting for stopRecognition result to continue with execution
                            await recognizer.StopContinuousRecognitionAsync().ConfigureAwait(false);
                            stopProcessCompleted.TrySetResult(0); // StopSpeech() is waiting for this signal to continue with the execution
                            audioConfig.Dispose();
                            recognizer.Dispose();
                        }
                        else
                        {
                            await recognizer.RecognizeOnceAsync();
                        }
                    }
                }            

Is there a way to set a silence time before the service sets a period as a final of a sentence?

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,673 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.