Voice to text

Discussion in 'Community Workshop' started by Not Lifting Off, Apr 27, 2016.

  1. Not Lifting Off

    Not Lifting Off Well-Known Member

    Joined:
    Dec 5, 2015
    Ratings:
    +368 / 0 / -0
    The way the current chat system is even after the latest update is hard work, for me anyway and typing while driving with no saved quick text is a nightmare. Would speech to text work? Voice activated chat, voice to text kind of thing be usable?
    I play on public servers with a headset on but never use the mike so dont have need for teamspeak or anything like that, but the number of times i have been racing someone and wanted to say one thing or another but havnt been able to, partly down to the intense nature of the game and the guys racing\driving with, partly sitting in half light and not seeing the keyboard.
    Is there a way of using voice commands to activate ingame chat?
    Would be so much easier to say the word chat and have the curser there waiting for input, say what you have to say "voice to text" then send.
    I know as the game is, no, but could an app be created that would do that? Is it viable, is there something that will do that now?
     
    • Agree Agree x 1
  2. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    Technically, it is possible....like have an app on the client machine listening to your voice, convert it to chat and send it to the Game....but of course Sector 3 needs to create an API where we can pass commands/chat text and they take care of the rest.
     
  3. Not Lifting Off

    Not Lifting Off Well-Known Member

    Joined:
    Dec 5, 2015
    Ratings:
    +368 / 0 / -0
    Exactly this, it dosnt even have to send it, i can hit return no problem :)
    I was hoping yourself or Sir would come back and say yes, piece of cake have it done in no time ;)
    It would make chatty things so much easier while racing!
     
  4. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    That's not even an issue, as it can auto send your text...the issue is that Sector3 needs to add an API for us to communicate with the game and I from what I've seen here nothing gets done/added when it comes to APIs :)
     
  5. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    Thanks for using my proper title :)

    Speech recognition on Windows is dead easy if you know what you're listening for (a limited grammar) - this uses the same downloadable component that Crew Chief voice recognition uses. If you assume that you'll only ever say one of a specific set of possible phrases, then voice recognition is accurate (amazingly so) and requires no configuration. You could even specify the list of 'stuff' you might say - hundreds of phrases in some config file somewhere.

    The app then listens for these (and only these). The recognition result contains the text of what you said. This could be converted into a sequence of key presses ("c" to start the voice chat, then each key with, say, a 50ms delay between keys, then <return>).

    I don't know how easy it is to send key presses to Raceroom. This varies depending on how the app reads keyboard events. It might be dead easy or it might be a ballache (it's probably somewhere in between - sending key presses to PCars was a ballache and I gave up, but I think R3E might be easier).

    Listening for any speech (free diction) with Windows built-in voice recognition API is harder and requires some (limited) training to be completed by the user before it can accurately recognise. The process of turning it in to key presses and sending these to Raceroom would work the same way.

    Telling the app to start listening for a voice message could be done via a button press or by a 'key phrase' which it listens for continuously.

    None of this is particularly difficult, but getting those simulated key presses to be recognised by Raceroom *might* be fiddly.

    Rather than implementing this as a separate application I'd just add it to Crew Chief. I did intend to set up some key-press macros that were voice activated, to allow my app to pre-select a pit strategy, but I had no time to implement it. Well, that's not entirely true. I did implement a proof of concept but this was for PCars. It included the button triggered key press sequence but I couldn't get PCars to 'see' these key presses without resorting to a hacky 3rd party keyboard driver, which wouldn't be popular with users. Then I noticed that the key presses for Raceroom pit menu actions had weird issues with key-repeats. Those 2 issues kinda put me off, TBH.

    Anyway, tl;dr: Yes. It's possible. It should be added to Crew Chief. But I have no time at the moment, but this might change soon as the project I'm working on lurches towards self-destruction
     
    • Like Like x 1
  6. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    Thank you Sir! :)
     
  7. Not Lifting Off

    Not Lifting Off Well-Known Member

    Joined:
    Dec 5, 2015
    Ratings:
    +368 / 0 / -0
    Would be cool to see it implemented one way or the other, if i had the knowledge i would try it myself but alas my hours were wasted racing and gaming not coding and learning :(
     
  8. Gareth Smith

    Gareth Smith Well-Known Member

    Joined:
    Oct 29, 2015
    Ratings:
    +53 / 0 / -0
    I'm surprised the quick chat options are not enabled yet, multiplayer seems much more active these days and I've actually started playing online. I only need two mapped to keys/buttons. "soz, my fault" and "you utter twat". Get those in Crew Chief Sir and I will be a happy bunny.
     
    • Agree Agree x 1
  9. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    Well, getting 2 (or 1) phrase in CrewChief is exactly the same amount of work as getting 100 phrases :)
     
  10. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    And well done for addressing me properly
     
    • Funny Funny x 1
  11. Not Lifting Off

    Not Lifting Off Well-Known Member

    Joined:
    Dec 5, 2015
    Ratings:
    +368 / 0 / -0
    Mate, seriously, you have to get over that complex :)
     
    • Like Like x 2
  12. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    Oi, I'll add you to the crewchief shitlist if you keep that up :)
     
  13. Not Lifting Off

    Not Lifting Off Well-Known Member

    Joined:
    Dec 5, 2015
    Ratings:
    +368 / 0 / -0
    You finished this yet Jim?
    No biggy for me, im on everyone elses shitlist :)
     
    • Funny Funny x 1
  14. Vantskruv

    Vantskruv Member

    Joined:
    Oct 9, 2017
    Ratings:
    +23 / 0 / -0
    Sorry for polling you. You do not need to answer, hence, I am creating a plugin for R3E on Streamdeck, which purpose is to easy setup pit-options. But a wall of bricks is facing me, as R3E will not recognize key-inputs (I am using SendInput in C++), tried both DInput scancodes and simple characters. How did you solve it for R3E?
     
  15. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    My codebase is c# so it might work a little differently, but I had no issues with scan codes. It just worked, as long as the game window was on top. I also used dxinputsim, which also worked.

    Perhaps there's something helpful in the cc code on gitlab
     
    • Love it! Love it! x 1
  16. Vantskruv

    Vantskruv Member

    Joined:
    Oct 9, 2017
    Ratings:
    +23 / 0 / -0
    Thanks mate!
    I have been looking at your code, I should not differ too much from C++ hopefully.
    It can also be that I need to disable UIPI (but that breaks the plugin in Streamdeck), I will test externally and see if it works, I have some leads now that nothing special seems to be done on your side. :)
    Thanks again!