Add New AIML Categories with Your Voice
Add Main Script Code - Change the Path as Needed
saywait("Starting A I M L learning")
##SoundNote("c2",2000)
$UniqueTime = $year + "." + $month + "." + $day + "-" + $hour + "." + $minute + "." + $second
$AIMLPath = "C:\Users\Thomas\Documents\AIML_Simone\aiml"
$AIMLFilename = $AIMLPath + "\0AIMLCode" + $UniqueTime + ".aiml"
print($AIMLFilename)
FileWriteLine($AIMLFilename,"")
$bLearningAIML = true
:AddNewAIML
################# ADD INPUT ###############
saywait("When you hear the beep please add new input.")
sleep(1000)
saywait("beep")
sleep(200)
controlCommand("Bing Speech Recognition", "StartListening")
controlCommand("Bing Speech Recognition", "UnpauseListening")
sleep(3000)
controlCommand("Bing Speech Recognition", "PauseListening")
controlCommand("Bing Speech Recognition", "StopListening")
#sleep(2000)
$sAIMLInput = $BingSpeech
print($BingSpeech)
saywait("New input was learned.")
################# ADD OUTPUT ###############
sleep(2000)
saywait("When you hear the beep please add new output.")
sleep(1000)
$bLearnAIML = true
saywait("beep")
sleep(200)
controlCommand("Bing Speech Recognition", "StartListening")
controlCommand("Bing Speech Recognition", "UnpauseListening")
sleep(3000)
controlCommand("Bing Speech Recognition", "PauseListening")
controlCommand("Bing Speech Recognition", "StopListening")
sleep(2000)
$sAIMLOutput = $BingSpeech
saywait("New output was learned.")
print("Heard:" + $BingSpeech)
$sAIMLLineOfCode = ""+ $sAIMLInput + " " + $sAIMLOutput + " "
print($sAIMLLineOfCode)
FileWriteLine($AIMLFilename,$sAIMLLineOfCode)
saywait("New AIML was added to the file")
sleep(1000)
############ DOES USER WANT TO ADD MORE? #############
saywait("do you want to add another category?")
sleep(1000)
saywait("beep")
sleep(200)
controlCommand("Bing Speech Recognition", "StartListening")
controlCommand("Bing Speech Recognition", "UnpauseListening")
sleep(2000)
controlCommand("Bing Speech Recognition", "PauseListening")
controlCommand("Bing Speech Recognition", "StopListening")
sleep(1000)
$sAnotherYesNo = $BingSpeech
print("Heard:" + $BingSpeech)
if($sAnotherYesNo = "Yes")
goto(AddNewAIML)
endif
print("Heard:" + $BingSpeech)
############ FINALIZE AND WRITE NEW FILE ##############
sleep(1000)
saywait("Finalizing A I M L document.")
FileWriteLine($AIMLFilename,"")
sleep(2000)
controlCommand("AimlBot", "ReloadConfig")
saywait("The new A I M L file is ready to use.")
$bLearningAIML = false
Open the settings dialog of the new script you created. Paste the above code into it. save the settings.
Hello Super le code . Merci beaucoup .
nice program will try it out
@Thomas,
Hi Thomas. If you have time could you make a video of each step to make this work. I am having a hard time following your steps to crate AIML using my voice. Do I need other plug-in to make this work.
Thank you in advance. Cheers
this is excellent, just what i was looking for
I just saw these.
I will try to make a video.
This requires the bing voice input skill.
Yes that is what I am using... i am using that and part of your code to listen...
Wait for user voice input and store input
controlCommand("Bing Speech Recognition", "StartListening") controlCommand("Bing Speech Recognition", "UnpauseListening") sleep(3000)
print($BingSpeech)
this all works
then I do this... if ($BingSpeech = "how are you")
do something
Endif
even though the $BingSpeech printed "how are you" from my voice, the If statement does not fire am I missing something?