Archives‎ > ‎AI_Tutorials‎ > ‎

Creating the chat bot 3 - The speech Addon

posted Oct 26, 2014, 5:18 AM by Leroy Dyer   [ updated Oct 26, 2014, 5:30 AM ]
 Speech is an important part of communication, the microsoft speech API offers all we need to consume. 

Lets Use it!

The speech add on : here we add Microsoft speech to our project.

Imports System.Speech.Recognition
Imports System.Speech.Synthesis

'Speech synthasis methods
    '------------------------------------------------------------------------------------------------------------------------------------------------------

    ''' <summary>
    ''' enables voice recognition engine
    ''' </summary>
    ''' <remarks></remarks>
    Public WithEvents RecoEngine As New SpeechRecognitionEngine()
    ''' <summary>
    ''' Enable TexttoSpeech
    ''' </summary>
    ''' <remarks></remarks>
    Private SpeechSynth As New SpeechSynthesizer



    ''' <summary>
    ''' Sets up Speech Recognition for use
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub SetupRecognition()

        RecoEngine.LoadGrammar(New DictationGrammar())
        RecoEngine.SetInputToDefaultAudioDevice()
        RecoEngine.RecognizeAsync()
    End Sub

    ''' <summary>
    ''' Activated on completion of recognition
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Private Sub RecoEngine_RecognizeCompleted(ByVal sender As Object, ByVal e As System.Speech.Recognition.RecognizeCompletedEventArgs) Handles RecoEngine.RecognizeCompleted
        RecoEngine.RecognizeAsync()
    End Sub

    ''' <summary>
    ''' On recogonizing speech the input is sent to the response routine
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Private Sub RecoEngine_SpeechRecognized(ByVal sender As Object, ByVal e As System.Speech.Recognition.RecognitionEventArgs) Handles RecoEngine.SpeechRecognized
      
        'a call to act is requird here 
        ProcessInputText(e.Result.Text)
    End Sub

    ''' <summary>
    ''' Speaktext Uses the internal speech system to speak the text, using the SAPI
    ''' </summary>
    ''' <param name="NewText">String: Text to be spoken</param>
    ''' <remarks></remarks>
    Public Sub SpeakText(ByRef NewText As String)

        SpeechSynth.Speak(NewText)
    End Sub


Articles about AI concepts

  • Home Automation HomeSeer includes a built-in web server, giving you access to all your devices from anywhere in the world using any web browser. The program works great if you have ...
    Posted Oct 21, 2014, 6:57 PM by Leroy Dyer
  • The conceptnet module ConceptNet 5 comes largely from the hard work of hundreds of thousands of people who gave their time and knowledge for free. So ConceptNet is free as well, released under ...
    Posted Oct 21, 2014, 6:35 PM by Leroy Dyer
  • Scripting for Conceptual Respresentation Knowledge representation Knowledge representation is crucial. One of the clearest results of artificial intelligence research so far is that solving even apparently simple problems requires lots of knowledge. Really understanding ...
    Posted Oct 21, 2014, 6:46 PM by Leroy Dyer
  • Athena Project A preview of the Athena project by Arron Snow <SNOWMAN> http://aaronwsnow.com An example of Custom AI, The Steps, The Mind-Set... Why are people so interested in AI ...
    Posted Oct 18, 2014, 6:13 AM by Leroy Dyer
  • IS A-I POSSIBLE Human intelligence involves both ``mundane'' and ``expert'' reasoning. By mundane reasoning I mean all those things which (nearly) all of us can routinely do (to various abilities) in order to ...
    Posted Oct 18, 2014, 5:08 AM by Leroy Dyer
Showing posts 1 - 5 of 5. View more »

ċ
Creating a Chatbot 3.zip
(376k)
Leroy Dyer,
Oct 26, 2014, 5:18 AM
Comments