Error message: Due to service inactivity, the client buffer exceeded the maximum size, resetting the buffer, did you update the subscription info

**Service **: Azure cognitive speech-to-text service

Description: I am using speech-to-text .net SDK and developing a system to convert event audio recordings to text, the audio file could be any size but I am getting intermittent above errors for a 60-minute recording. I have a standard pricing plan and there is no option to upgrade as it is also asking to update your subscription.

Once I got the error it stopped the converting in the middle and we needed to run again the program.

Please refer below screenshot

enter image description here

Expectation: It should run without fail and not stop converting the text.

1

There are 1 best solutions below

1
Dasari Kamali On

Error message: Due to service inactivity, the client buffer exceeded the maximum size, resetting the buffer, did you update the subscription info

The above error occurred because the resource you are trying is inactive, or the service might require refreshed credentials or an active subscription. Check if the speech service resource is available in the Azure portal.

I tried the code below to convert an 80-minute .wav file to text and successfully converted it into speech-to-text.

Code :

using System;
using Microsoft.CognitiveServices.Speech;
using System.Threading.Tasks;
using Microsoft.CognitiveServices.Speech.Audio;

class Program
{
    static async Task Main(string[] args)
    {
        string subscriptionKey = "<speech_key>";
        string serviceRegion = "<speech_region>";

        var speechConfig = SpeechConfig.FromSubscription(subscriptionKey, serviceRegion);
        var audioConfig = AudioConfig.FromWavFileInput("C:/Users/kamali/Documents/kamSP.wav");

        using var speechRecognizer = new SpeechRecognizer(speechConfig, audioConfig);

        speechRecognizer.Recognizing += (s, e) =>
        {
            Console.WriteLine($"Recognizing: {e.Result.Text}");
        };

        speechRecognizer.Recognized += (s, e) =>
        {
            if (e.Result.Reason == ResultReason.RecognizedSpeech)
            {
                Console.WriteLine($"Recognized: {e.Result.Text}");
            }
            else if (e.Result.Reason == ResultReason.NoMatch)
            {
                Console.WriteLine("No speech could be recognized.");
            }
        };

        speechRecognizer.Canceled += (s, e) =>
        {
            Console.WriteLine($"CANCELED: Reason={e.Reason}");

            if (e.Reason == CancellationReason.Error)
            {
                Console.WriteLine($"ErrorDetails: {e.ErrorDetails}");
            }
            else if (e.Reason == CancellationReason.EndOfStream)
            {
                Console.WriteLine("End of the audio stream reached.");
            }
        };

        await speechRecognizer.StartContinuousRecognitionAsync();

        Console.WriteLine("Press Enter to stop the recognition...");
        Console.ReadLine();

        await speechRecognizer.StopContinuousRecognitionAsync();
    }
}

Output :

It ran successfully and converted the speech to text, as shown below.

enter image description here enter image description here enter image description here