Main Content

reset

Reset states for streaming-enabled speech clients

Since R2024a

    Description

    reset(clientObj) resets the internal state of the streaming-enabled speechClient object.

    Examples

    collapse all

    Create an Emformer speechClient object for streaming speech-to-text. Create a dsp.AudioFileReader object to read in an audio file.

    emformerSpeechClient = speechClient("emformer");
    afr = dsp.AudioFileReader("Counting-16-44p1-mono-15secs.wav");

    Perform streaming speech-to-text in a loop and print out the transcription.

    txtTotal = "";
    while ~isDone(afr)
        x = afr();
        txt = speech2text(x,afr.SampleRate,Client=emformerSpeechClient);
        txtTotal = txtTotal + txt;
    end
    
    txtTotal
    txtTotal = 
    "one two three four five six seven eight nine"
    

    Reset the state of the Emformer speechClient object to start streaming speech-to-text on a new audio file.

    reset(emformerSpeechClient)
    afr = dsp.AudioFileReader("Rainbow-16-8-mono-114secs.wav");
    
    txtTotal = "";
    while ~isDone(afr)
        x = afr();
        txt = speech2text(x,afr.SampleRate,Client=emformerSpeechClient);
        txtTotal = txtTotal + txt;
    end
    
    txtTotal
    txtTotal = 
    "when the sunlight strikes rain dro drops in the air act as a prism and form a rainbow the rainbow is a division of white light into many beautiful colors these take the shape of a long arch with its path high above and two ends apparently beyond the horiz there is according to lege ailing pot of gold at one end people look but no one ever finds it when a man looks for something beyond his reach his friend say he is looking for the pot of gold at the end of the rainbow throughout the centuries people have explained the rainbow in various ways some have accepted it as a miracle without physical explanation to the hebrews it was a token that there would be no more universal floods the greeks used to imagine that was a sign from the gods to foretell war or heavy rain the norsemen considered the rainbow as a bridge over which the gods from the earth to their home in the sky others have tried to explain the phen arist thought the rainbow was caused bylection of the sun's by the sun since then physic have found that is not a reflection but refraction by raindrops which causes the rainbows many complicated ideas about the rainbow have been formed the difference in the rainbow depends considerably on thes oft the width of the coloured band increase of the drops increases the actual primary rainbow observed is said to be the effect of a superim of a number of bows if the red of the secondbow falls upon the green of the first the result the result is to give a bow with an abnorm wide yellow band since red and green light when mix from yellow this is a very common type ofa one showing manly red and yellow with little or no green or blue"
    

    Input Arguments

    collapse all

    Client object to reset, specified as an object returned by speechClient. Resetting the internal state applies only to the Emformer speech-to-text model returned by calling speechClient with "emformer".

    Version History

    Introduced in R2024a