Giter Site home page Giter Site logo

Comments (9)

foolip avatar foolip commented on July 28, 2024 1

@ThanhLNP if you set recognition.interimResults = false, do you get a different behavior?

Is the behavior you're expect that you always see a final event where isFinal is true, even if the interim results ended up being correct?

from speech-api.

foolip avatar foolip commented on July 28, 2024

@ThanhLNP can you elaborate a little bit? Are you running this code on some browser and never get an event where event.results[i].isFinal is true? I suspect that's because of recognition.continuous = true, but isn't this the behavior you expected?

from speech-api.

ThanhLNP avatar ThanhLNP commented on July 28, 2024

Thank you for the reply,
i'm running on chrome,
and I still want recognition.continuous = true,
but i don't get isFinal like on this demo page https://www.google.com/intl/en/chrome/demos/speech.html

from speech-api.

ThanhLNP avatar ThanhLNP commented on July 28, 2024

Is there a way I can get isFinal = true while recognition.continuous = true?

from speech-api.

ThanhLNP avatar ThanhLNP commented on July 28, 2024

Yes, that's what I mean

For example, when I say "one" I want to get "1" right after
keep saying "two" then I just get "2" right after

Thank you

from speech-api.

foolip avatar foolip commented on July 28, 2024

@ThanhLNP I was wondering about the case where the interim result is actually correct. Let's say I speak "hello world" and get a first "result" event for "hello" with isFinal being false, but it turns out that "hello" is correct. Are you then expecting another "result" event with "hello" but with isFinal being true? Or is the problem specifically about numbers, "one" vs. "1"?

It would be helpful if you could share a log of the result events you see, what the resultIndex is, and what's in the results list in each event.

from speech-api.

ThanhLNP avatar ThanhLNP commented on July 28, 2024

Yes, the problem is with numbers
but the real problem is I want to get word by word as soon as I say (with recognition.continuous = true), not just get it after stop
as with this demo page: https://www.google.com/intl/en/chrome/demos/speech.html, I see that words are bold after a while, not after stopping

from speech-api.

ThanhLNP avatar ThanhLNP commented on July 28, 2024

after I added some other handlers I finally got the final_transcript value, I have a demo clip you can check out.

I just want to say that I get the final_transcript value quite slowly, and it returns a lot of times (you can see in the clip)

Your project is wonderful, thank you, and hope it gets better and better
https://drive.google.com/file/d/1MYyN9Z8EXIZfEebdkZFRTIosx8jiso65/view?usp=sharing

continuous = true;
...
recognition.onresult = function(event) {
if (continuous) {
var interim_transcript = '';

    for (var i = event.resultIndex; i < event.results.length; ++i) {
        if (event.results[i].isFinal) {
            final_transcript = event.results[i][0].transcript;
        } else {
            interim_transcript = event.results[i][0].transcript;
        }
    }
} else {
    final_transcript = event.results[0][0].transcript;
}

console.log(final_transcript);

*** some other handles ***

};

from speech-api.

foolip avatar foolip commented on July 28, 2024

@ThanhLNP thanks for putting together the demo! At this point it seems fairly clear that this isn't necessarily an issue with the spec, which defines all of the events being fired here, but an implementation issue, where Chrome is not behaving the way you're expecting it. Would you be able to file an issue https://crbug.com/new with a test case attached?

from speech-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.