Package: voicecoding
Aboutvoicecoding is a program that will allow people to code in Python using their voice. Using different voice commands that can be found in thedocumentation, users can perform simple tasks in Python in an environment similar to the Python command-line interpreter. voicecoding is currently only a command-line application, but the plan is for it to eventually become a full Python IDE controlled completely by voice, while still staying open source and free. You can check this project out onPyPior fork it onGithub.After you’veinstalledthe program, you can run it by typingpython-mvoicecodingin your command prompt or terminal.InstallationOn all operating systems, you first need to install the program itself usingpip:pip install voicecodingThat will also installSpeechRecognitionwhich voicecoding depends on. You will have to manually installPyAudio, the other library that voicecoding depends on. The method of installation varies by operating system.Microsoft WindowsYou can simply just usepip:pip install pyaudioMac OS XFirst, you must install the PortAudio library withbrewand then usepipto install PyAudio:brew install portaudiopip install pyaudioUbuntu/DebianRun:sudoapt-getinstallpython-pyaudiopython3-pyaudioIf that does not work, you should just try installing withpip:pip install pyaudioDocumentationCommandsAssignstructure: “assign” {say adata typeand a value}
“to variable” {say a name for the variable}assigns a value to a variableexample inputs: “assign 10 to variable x”, “assign list hello cut
world to variable y”example outputs:x = 10,y = ["hello", "world"]Printstructure: “print” {say adata typeand a value}prints out a valueexample inputs: “print 10”, “print hello comma world exclamation
point”example outputs:print(10),print("hello,world!")Callstructure: “call” {say a function ormethodexpression}calls any function or method that may modify another piece of dataexample inputs: “call variable x method append parameters 1”, “call
variable x method pop”example outputs:x.append(1),x.pop()Importstructure: “import” {say any module name}imports a module to allow its method to be usedexample inputs: “import math”, “import web browser”example outputs:import math,import webbrowserIf/Elif/Elsestructure: “if comparison”(comparison is optional) {say acomparison} “elif comparison”(comparison is
optional) {say acomparison} “else” “end” -
unindents or ends entire statementscontrol flow statement based on logic; after saying one of the above
commands, you can use others command inside of itexample inputs: “if comparison variable x equals variable y”, “elif
variable x is greater than variable y”, “else”example outputs:if x == y:,elif x > y:,else:Forstructure: “for” {variable name} “in” {say an iterabledata
typeand a value} “end” - unindents or ends entire
statementcontrol flow statement that iterates over a data type; after using
the command, you can use other commands inside of itexample inputs: “for i in list one cut two cut three”, “for i in
function range params one hundred”example outputs:for i in [1, 2, 3]:,for i in range(100)Whilestructure: “while comparison”(comparison is optional) {say acomparison} “end” - unindents or ends entire
statementcontrol flow statement that will continue while a condition is true;
after using this command, you can use other commands inside of itexample inputs: “while comparison i is less than one hundred”, “while
true”example outputs:while i < 100:,while True:Definestructure: “define function”(function is optional) {say a name for
the function} “parameters variable”(variable is optional) {say a name
for the parameter} “cut” …used to allow users to define their own functions; after using this
command, you can use other commands inside of itexample inputs: “define function fibonacci parameters variable
number”, “define factorial params number”example outputs:def fibonacci(number):,def factorial(number):Returnstructure: “return” {say adata typeand a value}returns data from a function; can only be used in functionsexample inputs: “return variable x”, “return false”example outputs:return x,return FalseData TypesInteger*any whole numberstructure: “integer”(optional) {say any whole number}example inputs: “integer one”, “twelve”, “one hundred forty two”example outputs:1,12,142String*any piece of text; is iterablestructure: “string”(optional) {say anything}example inputs: “string hello comma world exclamation point”,
“space”, “if you’re reading this it’s too late”example outputs:"hello, world!"," ","if you're reading this it's too late"Float*a decimal numberstructure: “float”(optional) {say any decimal}example inputs: “float one point two”, “three point one four one five
nine”example outputs:1.2,3.14159Boolean*stores data as true or falsestructure: “boolean”(optional) {either “true” or “false”}example inputs: “boolean true”, “false”example outputs:True,FalseVariable**stores data typesstructure: “variable”(sometimes optional) {any name}example inputs: “variable x”, “variable hello world”, “i”example outputs:x,hello_world,iModule**allows you to use functions and methods from different Python files (note: always used with a method)stucture: “module method” {method name}example inputs: “module math method factorial parameters ten”, “module web browser method open params URL”example outputs:math.factorial(10),webbrowser.open(url)Equationfor math and simple string concatenationstructure: “equation” {say adata typeand a value}
{say anequation operator{say adata
typeand a value} …example inputs: “equation one plus five”, “equation 12 times 4 plus
3”, “equation 6 mod 5”example outputs:1 + 5,12 * 4  + 3,6 % 5Comparisonfor comparing different Python objectsstructure: “comparison” {say adata typeand a
value} {say acomparison operator} {say adata typeand a value} …example inputs: “comparison variable x is True”, “comparison ten is
greater than twenty five”, “comparison five is less than seven and
ten is greater than nine”example outputs:x is True,10 > 25,5 < 7 and 10 > 9Listordered group of different Python objects; is iterablestructure: “list” {say adata type} {say a value}
“cut” {say adata typeand a value} …example inputs: “list”, “list one cut two cut three”, “list hello cut
one point five”example outputs:[],[1, 2, 3],["hello", 1.5]Tupleimmutable sequence of Python objectsstructure: “tuple” {say adata type} {say a value}
“cut” {say adata typeand a value} …example inputs: “tuple”, “tuple one cut two cut three”, “tuple hello”example outputs:(),(1, 2, 3),("hello",)Setgroup of unordered, unique Python objectsstructure: “set” {say adata typeand a value}
“cut” {say adata type} {say a value} …example inputs: “set”, “set one cut one cut three”, “set hello cut
one point five”example outputs:set(),{1, 3},{"hello", 1.5}Functionblocks of code that can perform action on parameters; when naming a
builtin function, you can say what a shorthand name actually means;
ie: “integer” ->int(), “length” ->len(), “has attribute” ->hasattr()structure: “function” {say a function name} “parameters” {say adata
typeand a value} cut …example inputs: “function list parameters hello”, “function int
params string ten”example outputs:list("hello"),int("10")*Doesn’t have be said when using this data type in a command; ie: you
can just say “one” instead of “integer one” to get the result of1.**“Variable”doesn’t have to be said if the variable
has been defined, is being used as a parameter in afunctionormethod, or is the variable in afor loop.“Module”doesn’t have to be said if the module is already imported.Other ThingsMethodsblocks of code that are called on class instances to perform actionsstructure: {say adata typeand a value} “method”
{say a method name} “parameters” {say adata typeand a value} cut …example inputs: “variable x method append parameters one”, “space
method join params function list params hello”example outputs:x.append(1),"".join(list("hello"))Keywords“exit” - exits the program“cancel” - cancels a multiline statement without exiting the program“end” - unindents or ends afor loop,while loop,function definition, orif/elif/else statementEquation Operatorsfor use in equations+- “plus”-- “minus”*- “times”, “multiplied by”/- “divided by”**- “to the power of”%- “mod”, “modulus”Comparison Operatorsfor use in comparison expressions==- “equals”, “is equal to”!=- “does not equal”, “is not equal to”>- “is greater than”<- “is less than”>=- “is greater than or equal to”<=- “is less than or equal to”Key wordsandorisnotinShorthand words“params” can be used in place of “parameters”