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
» JMaster Duel Bot: A Yu-Gi-Oh! Master Duel Bot and Trainer for Steam
AI That Talks To You EmptyYesterday at 5:26 am by Bully@WiiPlaza

» Error Injecting Drool Links Saliva Mod Menu
AI That Talks To You EmptyYesterday at 5:24 am by Bully@WiiPlaza

» USB Gecko problems with some games
AI That Talks To You Empty10/16/2024, 1:59 pm by Reclaimer Shawn

» Metal Gear Solid V The Phantom Pain X Flashpoint Batman Gameplay unedited [Seth@WiiPlaza]
AI That Talks To You Empty9/23/2024, 12:48 pm by Seth@WiiPlaza

» Dropped Out of College to Pursue Web Dev and Life Pursuits in General
AI That Talks To You Empty8/9/2024, 7:09 am by SnB@BWH

» Lego Stars Wars: The Complete Saga [RLGE64]
AI That Talks To You Empty8/1/2024, 2:04 am by Whatever_1240

» ASM <> Gecko Code Converter
AI That Talks To You Empty7/29/2024, 11:15 am by Mac11ngAround

» German With a Jackhammer
AI That Talks To You Empty7/28/2024, 3:42 pm by SnB@BWH

» Wii RAM Hacking: Pointers and ASM
AI That Talks To You Empty7/23/2024, 1:54 pm by Mac11ngAround

» IBM AIX Assembler Programming Reference - Useful For PPC ASM
AI That Talks To You Empty7/21/2024, 5:00 pm by Mac11ngAround

Search
 
 

Display results as :
 


Rechercher Advanced Search

November 2024
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
252627282930 

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