Hi all,
I got the Keep Alive and Gold/Elixir search in my script working (playing the game on BlueStacks). And I also have voice commands for my troops working ("Send 10 giants from the north east" etc) ... well sort of.. sometimes ms SAPI cant pick up my words... so what I want to do is train sapi using the built in voice training dialog... I'm just not sure how to bring up the dialog thru the COM interface... This is what i got:
pspeaker := ComObjCreate("SAPI.SpVoice")
pspeaker.volume := 100
plistener := ComObjCreate("SAPI.SpInprocRecognizer") ; For not showing Windows Voice Recognition widget.
paudioinputs := plistener.GetAudioInputs() ; For not showing Windows Voice Recognition widget.
plistener.AudioInput := paudioinputs.Item(0) ; For not showing Windows Voice Recognition widget.
ObjRelease(paudioinputs) ; Release object from memory, it is not needed anymore.
pcontext := plistener.CreateRecoContext()
pgrammar := pcontext.CreateGrammar()
pgrammar.DictationSetState(0)
prules := pgrammar.Rules()
prulec := prules.Add("wordsRule", 0x1|0x20)
prulec.Clear()
pstate := prulec.InitialState()
; add more like this here
pstate.AddWordTransition(ComObjParameter(13, 0), "giants")
pstate.AddWordTransition(ComObjParameter(13, 0), "send")
..
..
F1:
;********** bring up voice recognition dialog *** not working
WinGet, active_id, ID, A
pspeaker.displayui(active_id, "Training", "SPDUI_UserTraining")
Note: I do not want the user to go thru control panel and do voice training there... i want to be able press a button and have the voice trainning dialog popup with the COC commands ("Giants,Archers,Attack,Rage Spell,South West" etc)..
Thanks for the help
MS SAPI Voice training for clash of clans Topic is solved
Ask gaming related questions (AHK v1.1 and older)
MS SAPI Voice training for clash of clans Topic is solved
Post by Guest » 30 Oct 2014, 21:26
Jump to
- AutoHotkey Foundation
- ↳ About This Community
- ↳ Forum Issues
- AutoHotkey (v2, current version)
- ↳ Ask for Help (v2)
- ↳ Gaming
- ↳ Scripts and Functions (v2)
- ↳ Gaming
- ↳ Tutorials (v2)
- ↳ Tips and Tricks
- ↳ Wish List
- ↳ Suggestions on Documentation Improvements
- ↳ Bug Reports
- ↳ AutoHotkey Development
- ↳ AutoHotkey_H
- ↳ Ask for Help
- ↳ Development
- ↳ Editors
- ↳ Adventure IDE
- ↳ Old Topics
- ↳ AHK Studio
- ↳ Notepad++
- ↳ Pulovers Macro Creator
- ↳ SciTE4AutoHotkey
- ↳ Visual Studio Code
- ↳ Announcements
- ↳ General Discussion
- AutoHotkey (v1.1 and older)
- ↳ Ask for Help (v1)
- ↳ Gaming Help (v1)
- ↳ Scripts and Functions (v1)
- ↳ Gaming Scripts (v1)
- ↳ Tutorials (v1)
- ↳ Tips and Tricks (v1)
- General
- ↳ Other Utilities & Resources
- ↳ Other Programming Languages
- ↳ C/C++
- ↳ ASM
- ↳ C#
- ↳ KeySharp
- ↳ Off-topic Discussion
- ↳ RPA
- Other languages
- ↳ Looking for Volunteers in other languages
- ↳ Deutsch (German)
- ↳ Ich brauche Hilfe
- ↳ Spiele
- ↳ Skripte und Funktionen
- ↳ Tutorials
- ↳ Tooltime
- ↳ Allgemeines
- ↳ 中文 (Chinese)
- ↳ 请求帮助
- ↳ 脚本函数
- ↳ 教程资料
- ↳ 相关工具
- ↳ 其他
- ↳ Español (Spanish)
- ↳ Pedir Ayuda
- ↳ Automatización de Juegos
- ↳ Scripts y Funciones
- ↳ Tutoriales
- ↳ Otras Utilidades y Recursos
- ↳ General
- ↳ Русский (Russian)
- ↳ Помощь
- ↳ Скрипты для Игр
- ↳ Скрипты и библиотеки
- ↳ Статьи и руководства
- ↳ Прочие ресурсы и ПО.
- ↳ Свободное общение
- ↳ Français (French)
- ↳ J'ai besoin d'aide
- ↳ Scripts et Fonctions
- ↳ Tutoriels
- ↳ Autres Utilitaires et Ressources
- ↳ Hors Sujet
- ↳ Português (Portuguese)
- ↳ Ajuda e Suporte Geral
- ↳ Scripts e Funções
- ↳ Tutoriais
- ↳ Outras Ferramentas e Recursos
- ↳ Outros Assuntos
- ↳ 한국어 (Korean)