BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup

Join the forum, it's quick and easy

BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks
Would you like to react to this message? Create an account in a few clicks or log in to continue.
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Latest topics
» Dropped Out of College to Pursue Web Dev and Life Pursuits in General
AI That Talks To You Empty4/7/2024, 2:34 pm by SnB@BWH

» Bully Made It Into a BIG Video 400K Views
AI That Talks To You Empty4/7/2024, 6:58 am by Bully@WiiPlaza

» Wii Play Tanks
AI That Talks To You Empty3/24/2024, 2:46 pm by helpmeout

» [Bypass Paywalls] (Global) @magnolia1234 - GitLab
AI That Talks To You Empty3/18/2024, 3:55 am by Seth@WiiPlaza

» [Download] Mary Shelley's Frankenhole
AI That Talks To You Empty3/16/2024, 8:29 am by Seth@WiiPlaza

» Completely Custom Modded Controllers (Undetectable)
AI That Talks To You Empty3/5/2024, 1:55 pm by Shadow@BWH

» (Zombies) Drink perks code?
AI That Talks To You Empty3/5/2024, 1:24 pm by Shadow@BWH

» Die Rückkehr zu STEAM und WARFACE
AI That Talks To You Empty3/2/2024, 3:54 am by Seth@WiiPlaza

» First person hand model change?
AI That Talks To You Empty2/28/2024, 4:53 am by Ad3lamac611

» {RELEASE} Field Raider Firefox v1.72 by Seth@WiiPlaza
AI That Talks To You Empty2/21/2024, 8:52 am by naxil

Search
 
 

Display results as :
 


Rechercher Advanced Search

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar

Country Statistics
Free counters!

You are not connected. Please login or register

AI That Talks To You

Go down  Message [Page 1 of 1]

1AI That Talks To You Empty AI That Talks To You 11/29/2019, 6:51 pm

XxModZxX@WiiPlaza

XxModZxX@WiiPlaza
Mod Skid Programmer, Coder & Hacker

Hello everyone, I know this is basic stuff in C# that uses basic .NET API's and references but would like to share it for the people who don't know very much C# or coding at all.

Now starting with explaining the program:
The program can be modified or edited how ever you really want it. And made to respond to you how ever you want it to really. It is a very basic program and can probably be modified to do a lot more then I have it to do. The program first gets what ever word it thinks you said(I'm going to tell you right now that the speech recognition is very trash if you want to go to real stuff I'd recommend Google's API but it costs money I couldn't find any free) it will output it on your console and show you what it thinks you said then takes it and compares it to a string to see if you want the AI to respond to you or not and if not it will just sit there and be quiet

Disclaimer: I take no credit for the code below as I am not the first one to find this nor write this most likely.
The boring code part:
I will be using JetBrains Rider since I kinda like it more now for Console Applications but still use Visual Studio for most of my programs it is up to personal choice to what you want to use. I will be first showing screenshots of the code then breaking it down into more simple pieces for people who don't understand the language

Main Function:
AI That Talks To You Screen12

Code:
      static  SpeechSynthesizer Synthesizer = new SpeechSynthesizer();

Used in the second function to be able to speak back to the user

The Main function is used to run any code on start up of the program. In this function you can see that instantly you are using the microphone to see what the user is saying(and no it's not exported to a .mp3 or anything so chill out it can't record your mic)



Code:
using(SpeechRecognitionEngine speechRecognitionEng = new SpeechRecognitionEngine(new System.Globalization.CultureInfo("en-US")))
This piece of code is just telling the computer that we are using the SpeechRecognitionEngine with the string"speechRecognitionEng" and that we are creating a new engine with the culture being "en-US". The "en-US" is used to address what type of language you will need to recognize for the user to understand it.

Code:
 speechRecognitionEng.LoadGrammar(new DictationGrammar());
                speechRecognitionEng.SetInputToDefaultAudioDevice();
                speechRecognitionEng.RecognizeAsync(RecognizeMode.Multiple);


Since this is kinda all speechRecognitionEng we will be explaining it all together.

"LoadGrammer" is just doing what is says it is loading the grammer and for the user to understand. "SetInputToDefaultAudioDevice" is just setting the default microphone input to the default microphone on the computer so we can use that later to write it to the console window and see what we are saying. "RecognizeAsync" is just opening another speech recognition operation which opens up to listen to multiple threads(Not very sure on that to be honest). Console.ReadLine just makes sure that the console stays open while everything is going on

Code:
                speechRecognitionEng.SpeechRecognized += speechRecognition;

The code "SpeechRecognized" is just doing what it says it is doing it is recognizing what is said and the function "speechRecognition" is telling it what to do from there.

Response Class:
AI That Talks To You Screen12

The response class is what it says it is. It is just telling the main function to do when it gets input into the microphone.

Code:
var result = e.Result.Text.ToLower();
           
            Console.WriteLine("Recognized text: " + e.Result.Text);

"var result" is just a local string native to that function used for later in the talking part of it so I don't have to sit there and retype that it just makes it easier on yourself. Console.WriteLine is just getting the text that is recognized and outputting it onto the console. "e" is a Event handler argument that is the words that the user has said for the computer to pick up.

Now to the speaking part

Code:
            if (result == "hello")
            {
                Synthesizer.Speak("Hello There");
            }

If the result(remember all result is is "e.Result.Text.ToLower();") matches(==) to the word placed in the string then Sythensizer.Speak will trigger saying what ever you want it to say

This is just as simple as it gets with it. You could go more out with it you could also write a array for the result stuff which makes it 10000x easier then the way I do it but it's just a basic program that I wrote at 5AM and decided to write up on it.

If you don't understand something or need help with something let me know and I can try my best to help you

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum