Microphone input pick up for js ( Speech recognition )

Hello I am trying to use speech recognition in fivem, the input is detected in the browser but when I do I try it in fivem I don’t get the same result. Actually I get no response at all.

this is what I have gathered so far

    try {
        var SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
        var recognition = new SpeechRecognition();
      }
      catch(e) {
        console.error(e);
    }
    recognition.continuous = true;
    recognition.onresult = function(event) {
        console.log("Here")
        var transcript = event.results[0][0].transcript; 
        $("#text").val(transcript);
    }

    navigator.mediaDevices.getUserMedia({ audio: true })
    .then(function(stream) {
      console.log('You let me use your mic!')
    })
    .catch(function(err) {
      console.log('No mic for you!')
    });

    recognition.start();
1 Like

Afaik SpeechRecognition APIs don’t work in FiveM Chromium since it’s a paid google api.

Is there any other methods possible or does that mean I just can’t? I saw another script out there that captures the microphone input but it is paid

hmm maybe look around on the internet if anyone has managed to do any of this somehow

What is the name of this script?

I found a way you can use SpeechRecognition with C# have you tried this ?

I have not, I have 0 knowledge in C# and I was willing to learn it for this but didn’t want to spend a lot of times learning it and not developing anything else just to end up not being able to do it. Maybe that is the solution.

Just give me a few days and I’ll give you the script

1 Like

Legend!

1 Like

Any update? I need this sooo much :sweat_smile: