Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Rugz007

[WIP|C#] Speech Recognition Mod

Recommended Posts

julionib

let me throw some ideas ^^:

 

Add a optinal hotkey that would be hold to enable the voice commands, if no hotkey is set you dont need to hold, works like actual one

 

Add commands like:

Fix car
Fix tyres
End car fire

Extra X (where x is a number between 1 and 9, this will toggle this vehicle extra on/off)

Heal me (increase player health)
I need help (spawn body guard)
Flip car

just some ideas :)

*edit: Oh yeah, make the reading of Jarvis.txt more "dynamic", dont make user put specific in "c:\program files\", you probably can use ".\Scripts\Jarvis mod\jarvis.txt" as path when reading and tell user to just paste all files in gta Scripts folder

Edited by julionib

Share this post


Link to post
Share on other sites
LordOfTheBongs

i like the idea of having to hold down a hotkey, kinda like talking on a walkie talkie (i dont think they use these anymore)

Share this post


Link to post
Share on other sites
pedro2555

i didnt read your source code but, its possible to you recognize a model name? like if i say "Spawn sabregt", it spawn a sabregt? that would be very cool, the problem is that my english is not that good and i would fail spawning some models ^^

It is possible to a certain extent. I've used the Speech SDK a long ago (XP Days), and let's say it wasn't the best Microsoft feature I've seen.

 

Microsoft provided U.S. English and Chinese recognition, but you could get other languages from third parties.

Share this post


Link to post
Share on other sites
julionib

basically what it does is "hear" microfone and return a string?

Edited by julionib

Share this post


Link to post
Share on other sites
AgentWD40

basically what it does is "hear" microfone and return a string?

IC381136.jpg

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Speech.Recognition;namespace WindowsFormsApplication1{  public partial class Form1 : Form  {    public Form1()    {      InitializeComponent();    }    private void Form1_Load(object sender, EventArgs e)    {      // Create a new SpeechRecognitionEngine instance.      SpeechRecognitionEngine recognizer = new SpeechRecognitionEngine();      // Create a simple grammar that recognizes "red", "green", or "blue".      Choices colors = new Choices();      colors.Add(new string[] { "red", "green", "blue" });      // Create a GrammarBuilder object and append the Choices object.      GrammarBuilder gb = new GrammarBuilder();      gb.Append(colors);      // Create the Grammar instance and load it into the speech recognition engine.      Grammar g = new Grammar(gb);      recognizer.LoadGrammar(g);      // use the system's default microphone, you can also dynamically      // select audio input from devices, files, or streams.      speechRecognitionEngine.SetInputToDefaultAudioDevice();      // Register a handler for the SpeechRecognized event.      recognizer.SpeechRecognized +=        new EventHandler<SpeechRecognizedEventArgs>(sre_SpeechRecognized);      // start listening in RecognizeMode.Multiple, that specifies      // that recognition does not terminate after completion.      speechRecognitionEngine.RecognizeAsync(RecognizeMode.Multiple);    }    // Create a simple handler for the SpeechRecognized event.    void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)    {      MessageBox.Show("Speech recognized: " + e.Result.Text);    }  }}
Edited by hardsty1e

Share this post


Link to post
Share on other sites
julionib

nice

Share this post


Link to post
Share on other sites
Rugz007

Hey julio thanks for uploding ut on fb.... and teleporting thing i a gonna add..... thanks man.

Share this post


Link to post
Share on other sites
julionib

no problem

Share this post


Link to post
Share on other sites
Silent

i didnt read your source code but, its possible to you recognize a model name? like if i say "Spawn sabregt", it spawn a sabregt? that would be very cool, the problem is that my english is not that good and i would fail spawning some models ^^

It seems to work ONLY when you add the words to a speech dictionary. Before I did that, it'd never properly hear me saying Domestobot, while after adding the word to a dictionary (even without recording a pronouncation) it was 100% accurate. Hopefully that'd be the case with car names too.

 

Now, it'd be even easier if it was possible to define a specific dictionary by script. Is it doable?

Share this post


Link to post
Share on other sites
julionib

mmm, well, at least for car names we could read the handling.dat or some file taht contains all car names (or obtain the car names list elsewhere) and add they as spawn commands with the word spawn + car name, im not sure about the result with cars like supergt, sultanrs

Share this post


Link to post
Share on other sites
Rugz007

Had To Stop Modding Issues :/

Share this post


Link to post
Share on other sites
Silent

mmm, well, at least for car names we could read the handling.dat or some file taht contains all car names (or obtain the car names list elsewhere) and add they as spawn commands with the word spawn + car name, im not sure about the result with cars like supergt, sultanrs

Wouldn't spawning by a GXT name be more reliable? Just obtain GXT keys and call CText::Get for those.

Edited by Silent

Share this post


Link to post
Share on other sites
julionib

i dont know, just i just throw an idea that would work in theory ^^

Share this post


Link to post
Share on other sites
PlayPrey

You liar, there is no blogger with that username...

Share this post


Link to post
Share on other sites
Wiebrendh

You liar, there is no blogger with that username...

 

He made a typo, his site is www.gta4mm.blogspot.in

But he did not make this mod by himselfe, he just copy pasted someone else his code :/

Share this post


Link to post
Share on other sites
AgentWD40

 

You liar, there is no blogger with that username...

 

He made a typo, his site is www.gta4mm.blogspot.in

But he did not make this mod by himselfe, he just copy pasted someone else his code :/

 

"System.Speech" has memory leaks anyways, i've tested your guys script and it does have issues as well. you can see for yourself with this code.

public void Helper(object sender, GraphicsEventArgs e)        {            if (gHud == true)            {                e.Graphics.Scaling = FontScaling.ScreenUnits;                e.Graphics.DrawText("Memory: " + (Process.GetCurrentProcess().PrivateMemorySize64 / 1024).ToString("0") + " KB", 0.63f, 0.8f);                e.Graphics.DrawText("Counter: ", 0.63f, 0.86f);                if (Game.FPS >= 31)                {                    e.Graphics.DrawText("FPS: " + Game.FPS.ToString(), 0.63f, 0.83f);                    Interval = 0;                }                else if (Game.FPS <= 30)                {                    e.Graphics.DrawText("FPS: " + Game.FPS.ToString(), 0.63f, 0.83f, System.Drawing.Color.Yellow);                    Interval = 40;                }                else if (Game.FPS < 11)                {                    e.Graphics.DrawText("FPS: " + Game.FPS.ToString(), 0.63f, 0.83f, System.Drawing.Color.Red);                    Interval = 200;                }            }        }
Edited by hardsty1e

Share this post


Link to post
Share on other sites
LordOfTheBongs

i dont think they understand what a memory leak is and why it is bad... instead of asking u to explain they just ignore, lol

Edited by LordOfTheBongs

Share this post


Link to post
Share on other sites
sherip008

 

case "Sports Car":

Vector3 scpos = Player.Character.Position.Around(10.0f);
World.CreateVehicle(new Model("COMET"), scpos);
currentFunction = null;
break;

What's "scpos" mean ?

Share this post


Link to post
Share on other sites
gamerzworld

 

 

case "Sports Car":

Vector3 scpos = Player.Character.Position.Around(10.0f);
World.CreateVehicle(new Model("COMET"), scpos);
currentFunction = null;
break;

What's "scpos" mean ?

 

Sports Car Position.

Edited by gamerzworld

Share this post


Link to post
Share on other sites
Rugz007

U got it....still crying

Share this post


Link to post
Share on other sites
sherip008

 

 

  1. case "Jarvis":
  2. Game.DisplayText("JARVIS Engine On");
  3. currentFunction = null;
  4. break;
  5. case "Normal Car":
  6. Vector3 nmpos = Player.Character.Position.Around(10.0f);
  7. World.CreateVehicle(new Model("SULTAN"), nmpos);
  8. currentFunction = null;
  9. break;
  10. case "Boat":
  11. Vector3 mbpos = Player.Character.Position.Around(10.0f);
  12. World.CreateVehicle(new Model("DINGHY"), mbpos);
  13. currentFunction = null;
  14. break;
  15. case "Heal Me":
  16. Player.Character.Health = 1000;
  17. Player.Character.Armor = 1000;
  18. break;
  19. case "Fack You":
  20. Game.DisplayText("JARVIS Engine Off");
  21. Player.Character.Health = 50;
  22. Player.Character.Armor = 0;
  23. currentFunction = null;
  24. break;
  25. case "Fix Car":
  26. if (Player.Character.isInVehicle())
  27. Player.Character.CurrentVehicle.Repair(
  28. Player.Character.CurrentVehicle.Wash();
  29. break;

Share this post


Link to post
Share on other sites
Jitnaught

 

 

 

  1. case "Jarvis":
  2. Game.DisplayText("JARVIS Engine On");
  3. currentFunction = null;
  4. break;
  5. case "Normal Car":
  6. Vector3 nmpos = Player.Character.Position.Around(10.0f);
  7. World.CreateVehicle(new Model("SULTAN"), nmpos);
  8. currentFunction = null;
  9. break;
  10. case "Boat":
  11. Vector3 mbpos = Player.Character.Position.Around(10.0f);
  12. World.CreateVehicle(new Model("DINGHY"), mbpos);
  13. currentFunction = null;
  14. break;
  15. case "Heal Me":
  16. Player.Character.Health = 1000;
  17. Player.Character.Armor = 1000;
  18. break;
  19. case "Fack You":
  20. Game.DisplayText("JARVIS Engine Off");
  21. Player.Character.Health = 50;
  22. Player.Character.Armor = 0;
  23. currentFunction = null;
  24. break;
  25. case "Fix Car":
  26. if (Player.Character.isInVehicle())
  27. Player.Character.CurrentVehicle.Repair(
  28. Player.Character.CurrentVehicle.Wash();
  29. break;

 

 

Why exactly did you post this?

Oh and there are 3 problems with this code. Well, actually just two problems, and another thing that should be changed. In the fack you case, you set the health as 50, but the problem is you could actually be giving health, if the player's health is below 50. So it should be this

Player.Character.Health -= 50;//Health = Health - 50

And then the two problems... both are in the fix car case.

1: You forgot to put the begin { and end } brackets for the if. The only time you DON'T put the brackets, is when there is only going to be one line of code in the if.

2: You forgot to put a " ); " at the end of the repair function.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.