Загрузка страницы

Coding by Voice with Voice Attack: a Practical Guide for Programmers

Programming with voice recognition is something I've wanted to try for a while. In this video, I let you know what I think and how to set it up for yourself using Voice Attack.

My Python Voice Attack profile: https://github.com/learncodebygaming/voiceattack
Get Voice Attack: https://voiceattack.com/
Tavis Rudd's presentation: https://www.youtube.com/watch?v=8SkdfdXWYaI
Voice Attack manual: https://www.voiceattack.com/VoiceAttackHelp.pdf
Discussion on how to setup Voice Attack dictation to type as you speak: https://forum.voiceattack.com/smf/index.php?topic=1825.0

I first learned about Voice Attack while playing Elite Dangerous.

VoiceAttack is uses the Windows Speech Engine that's built into Windows to perform its voice recognition. VoiceAttack provides the glue between the text to speech engine and executing your macros in response to what that engine hears.

In the options, which you get to from the wrench in lower right, and under "Recognition", I checked "show confidence level" so I can get a feel for how well the voice recognition is understanding me. You'll want to monitor the log over here when you're first using this software to get a feel for how it's working.

You can create different profiles to use with different applications. You can download my Python VoiceAttack profile if you want to start with that, or you can create a new one. Let me show you how I setup these commands so you can build something custom for yourself.

Let's start with the "slap" command, which in my profile just presses "Enter" on the keyboard. To do that you'd just edit the profile, and create a new command. Set "When I say" to "slap", and "when this command executes" select "Key Press". In the window that pops up, you can just press the key you want on your keyboard, so in this case "Enter", click "OK", and then just save it by clicking "OK" again.

In the "Edit a Profile" window click "Apply", and now with VSCode in focus, when I say "slap" a carriage return will happen. If you're not getting this to work, one thing to check is if your IDE is running in administrator mode like mine, then VoiceAttack must also be run as an administrator.

One thing to watch out for, is if I say "slap slap" (quickly twice like that), VoiceAttack will consider that its own command. So it won't do an "Enter" at all in that case, it will just show up as an unrecognized command. So to handle that, since I say this often, I just setup a new command for "slap slap" that hits "Enter" twice.

That was an easy one, so let's look at something more interesting. I use "new function" to quickly outline a new function for me. To do that, I'm using "Quick Input", which you can find under "Other", "VoiceAttack Action". And with this you can just give it a string and it will type out that string for you. You'll want to change the "Hold keys down for..." setting, I've got it at 0.030 seconds, because the default of 0.150 seconds will type pretty slowly.

In this "new function" command I also have a few more steps. I want the function name to get highlighted for me, so I can immediately type in the name for what I want to call my function. To do this I have an action to press the up key, then another one to press Ctrl + D, which in VSCode selects the entire word.

The "Quick Input" feature is nice, but it's still a little slow. Something you can do instead is copy the text you want to the Windows clipboard, and then just paste that. If we look at my setup for "new main", this generates all the boilerplate code I want for a main script. Under "Other", "Windows", you'll find "Set a Text value to the Windows clipboard". I've simply entered my code in there, and then added one more action to paste it with Ctrl + V.

In my "start program" command, I'm just having it press Ctrl + Alt + N, which is the shortcut I have in VSCode for running a script. So you can combine the keyboard shortcut features of whatever editor you're using with VoiceAttack to do some pretty powerful things without much effort.

Now when picking your command words, there are a few things to keep in mind. Be careful using one-syllable words, or words that sound alike, because they can get misheard pretty easily. Also, think about what sounds you have trouble saying clearly, like I have trouble with 'R's, so I try to avoid phrases that start with 'R'. Like I use "start program" instead of "run program".

When I was creating my profile, I initially used "Up" for the up arrow, but "Up" got confused with "snap" all the time. So then I tried using "Go up", but that was hard for it to understand, too, so I settled on "upper" and "downer" for up and down.

Things begin to get complicated when you start using dictation. Dictation is where you want the computer to listen to you and type exactly what you're saying.

Continue with the written tutorial here: https://learncodebygaming.com/blog/coding-by-voice-with-voice-attack-a-practical-guide-for-programmers

Видео Coding by Voice with Voice Attack: a Practical Guide for Programmers канала Learn Code By Gaming
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
14 января 2020 г. 3:48:22
00:17:05
Яндекс.Метрика