Software reference

This is the official Software reference of JustSayIt. Note that it can also be queried interactively from the Julia REPL using the help mode:

julia> using JustSayIt
julia>?
help?> JustSayIt

Functions to configure and start JustSayIt

Index

Documentation

JustSayIt.startFunction
start()
start(<keyword arguments>)

Start offline, low latency, highly accurate and secure speech to command translation.

NOTE: Support for German and Spanish deactivated

Support for German and Spanish is deactivated due to an unresolved issue with the underlying Vosk Speech Recognition Toolkit: https://github.com/alphacep/vosk-api/issues/1017

Keyword arguments

  • default_language::String="en-us": the default language, which is used for the command names, for the voice arguments and for typing when no other language is specified (noted with its IETF langauge tag https://en.wikipedia.org/wiki/IETFlanguagetag). Currently supported are: english-US ("en-us"), German ("de"), French ("fr") and Spanish ("es").
  • type_languages::String|AbstractArray{String}=default_language: the languages used for typing, where the first is the default type language (noted with its IETF langauge tag https://en.wikipedia.org/wiki/IETFlanguagetag). Currently supported are: english-US ("en-us"), German ("de"), French ("fr") and Spanish ("es"). Type ?Keyboard.type for information about typing or say "help type" after having started JustSayIt.
  • commands::Dict{String, <:Any}=DEFAULT_COMMANDS[default_language]: the commands to be recognized with their mapping to a function or to a keyboard key or shortcut or a sequence of any of those.
  • subset::AbstractArray{String}=nothing: a subset of the commands to be recognised and executed (instead of the complete commands list).
  • max_speed_subset::AbstractArray{String}=nothing: a subset of the commands for which the command names (first word of a command) are to be recognised with maxium speed rather than with maximum accuracy. Forcing maximum speed is usually desired for single word commands that map to functions or keyboard shortcuts that should trigger immediate actions as, e.g., mouse clicks or page up/down (in general, actions that do not modify content and can therefore safely be triggered at maximum speed). Note that forcing maximum speed means not to wait for a certain amount of silence after the end of a command as normally done for the full confirmation of a recognition. As a result, it enables a minimal latency between the saying of a command name and its execution. Note that it is usually possible to define very distinctive command names, which allow for a safe command name to shortcut mapping at maximum speed (to be tested case by case).
Advanced
  • modeldirs::Dict{String, String}: the directories where the unziped speech recognition models to be used are located. If modeldirs is not set, then it is automatically defined according to the default_language and type_languages set. Models are downloadable from here: https://alphacephei.com/vosk/models
  • noises::Dict{String, <:AbstractArray{String}}=DEFAULT_NOISES: for each model, an array of strings with noises (tokens that are to be ignored in the speech as, e.g., "huh").
  • audio_input_cmd::Cmd=nothing: a command that returns an audio stream to replace the default audio recorder. The audio stream must fullfill the following properties: samplerate=44100, channels=1 and format=Int16 (signed 16-bit integer).

Submodules for command name to function mapping

To see a description of a submodule, type ?<modulename>.

Examples

Define default_language (also used for typing if type_languages is not set)

# Set command and type language to french:
using JustSayIt
start(default_language="fr")

Define default_language and type_languages

# Set command language to french and type languages to french and spanish:
using JustSayIt
start(default_language="fr", type_languages=["fr","es"])

Define subset

# Listen only to the commands "help" and "type".
using JustSayIt
start(subset=["help", "type"])

Define custom commands - functions, keyboard shortcuts and sequences of those - and a max_speed_subset

using JustSayIt
commands = Dict("help"      => Help.help,
                "type"      => Keyboard.type,
                "ma"        => Mouse.click_left,
                "select"    => Mouse.press_left,
                "okay"      => Mouse.release_left,
                "middle"    => Mouse.click_middle,
                "right"     => Mouse.click_right,
                "double"    => Mouse.click_double,
                "triple"    => Mouse.click_triple,
                "copy"      => (Key.ctrl, 'c'),
                "cut"       => (Key.ctrl, 'x'),
                "paste"     => (Key.ctrl, 'v'),
                "undo"      => (Key.ctrl, 'z'),
                "redo"      => (Key.ctrl, Key.shift, 'z'),
                "upwards"   => Key.page_up,
                "downwards" => Key.page_down,
                "take"      => [Mouse.click_double, (Key.ctrl, 'c')],
                "replace"   => [Mouse.click_double, (Key.ctrl, 'v')],
                );
start(commands=commands, max_speed_subset=["ma", "select", "okay", "middle", "right", "double", "triple", "copy", "upwards", "downwards", "take"])

Define custom modeldirs

using JustSayIt
modeldirs = Dict(MODELNAME.DEFAULT.EN_US => "/home/runner/mymodels/vosk-model-small-en-us-0.15",
                 MODELNAME.TYPE.EN_US    => "/home/runner/mymodels/vosk-model-en-us-daanzu-20200905",
                 MODELNAME.DEFAULT.FR    => "/home/runner/mymodels/vosk-model-small-fr-0.22",
                 MODELNAME.TYPE.FR       => "/home/runner/mymodels/vosk-model-fr-0.6-linto-2.2.0")
start(modeldirs=modeldirs, default_language="en-us", type_languages=["en-us","fr"])

Define audio_input_cmd

# Use a custom command to create the audio input stream - instead of the default recorder (the rate, channels and format must not be chosen different!)
using JustSayIt
audio_input_cmd = `arecord --rate=44100 --channels=1 --format=S16_LE`
start(audio_input_cmd=audio_input_cmd)

Default commands

de    => Dict{String, Function}("email" => JustSayIt.Email.email, "internet" => JustSayIt.Internet.internet, "hilfe" => JustSayIt.Help.help, "schreibe" => JustSayIt.Keyboard.type)
en-us => Dict{String, Function}("help" => JustSayIt.Help.help, "type" => JustSayIt.Keyboard.type, "email" => JustSayIt.Email.email, "internet" => JustSayIt.Internet.internet)
es    => Dict{String, Function}("ayuda" => JustSayIt.Help.help, "escribe" => JustSayIt.Keyboard.type, "internet" => JustSayIt.Internet.internet, "email" => JustSayIt.Email.email)
fr    => Dict{String, Function}("écrire" => JustSayIt.Keyboard.type, "aide" => JustSayIt.Help.help, "internet" => JustSayIt.Internet.internet, "email" => JustSayIt.Email.email)

Default model directories

default-de    => /home/runner/.local/share/JustSayIt/models/vosk-model-small-de-0.15
default-en-us => /home/runner/.local/share/JustSayIt/models/vosk-model-small-en-us-0.15
default-es    => /home/runner/.local/share/JustSayIt/models/vosk-model-small-es-0.22
default-fr    => /home/runner/.local/share/JustSayIt/models/vosk-model-small-fr-0.22
type-de       => /home/runner/.local/share/JustSayIt/models/vosk-model-de-0.21
type-en-us    => /home/runner/.local/share/JustSayIt/models/vosk-model-en-us-daanzu-20200905
type-es       => 
type-fr       => /home/runner/.local/share/JustSayIt/models/vosk-model-fr-0.22

Default noises

default-de    => String[]
default-en-us => ["huh"]
default-es    => String[]
default-fr    => ["hum"]
type-de       => String[]
type-en-us    => ["huh"]
type-es       => String[]
type-fr       => ["hum"]
source
JustSayIt.@includeMacro
@include(path::AbstractString)

Prefix path with the JustSayIt application config path and then call include(path). If path is an absolut path, then call include with path unmodified.

NOTE: JustSayIt application config

The content of the JustSayIt application config folder is not evaluated within JustSayIt. The folder's single purpose is to provide an easily accessible storage for scripts to start JustSayIt and/or for custom command functions: @include permits to conveniently include files from this folder (for details about the Julia built-in include type ?include). Your JustSayIt application config path on this system is: /home/runner/.config/JustSayIt

source
JustSayIt.@editMacro
@edit(path::AbstractString)

Prefix path with the JustSayIt application config path and then call edit(path). If path is an absolut path, then call edit with path unmodified.

NOTE: JustSayIt application config

The content of the JustSayIt application config folder is not evaluated within JustSayIt. The folder's single purpose is to provide an easily accessible storage for scripts to start JustSayIt and/or for custom command functions: @edit permits to conveniently edit files from this folder (for details about the Julia built-in edit type ?edit). Your JustSayIt application config path on this system is: /home/runner/.config/JustSayIt

source

Submodules for command name to function mapping

Index

Documentation

JustSayIt.HelpModule

Module Help

Provides functions for displaying help about the commands during speech recognition.

Functions

To see a description of a function type ?<functionname>.

source
JustSayIt.EmailModule

Module Email

Provides functions for operations in an Email client.

Functions

Manage e-mails

To see a description of a function type ?<functionname>.

See also: Internet

source

Functions of Help

Index

Documentation

Functions of Keyboard

Index

Documentation

JustSayIt.Keyboard.typeFunction
type `text` | `words` | `letters` | `digits`

Type in one of the following modes:

  • text
  • words
  • letters
  • digits

Each of the modes supports a set of keywords which can trigger some immediate action or modify the handling of subsequent speech input. It is important to note that the speech is analysed in word groups which are naturally delimited by longer silences; and keywords are only considered as such if their word group does not contain anything else then keywords. This allows to determine whether a word that is recognised as a keyword should trigger some action or be typed instead.

Keywords

  • "terminus": end typing.
  • "language": change typing language.
  • "undo": undo typing of last word group.
  • "redo": redo typing of last word group.
  • "uppercase": type the first word of the next word group uppercase (automatic in text mode after '.', '!' and '?').
  • "lowercase": type the first word of the next word group lowercase (default).
  • "letters": interpret the next word group as letters (interprets in addition 'space' as ' ').
  • "digits": interpret the next word group as digits (interprets in addition 'dot' as '.' and 'space' as ' ').
  • "point": type '.'.
  • "comma": type ','.
  • "colon": type ':'.
  • "semicolon": type ';'.
  • "exclamation": type '!'.
  • "interrogation": type '?'.
  • "paragraph": start a new paragraph.

Modes

text

Type any kind of text supported by the keywords, including spelled letters, digits and punctuation marks. All keywords are supported.

words

Type words only (upper and lower case). Supported keywords are:

  • "terminus"
  • "undo"
  • "redo"
  • "uppercase"
  • "lowercase"

letters

Type letters only (upper and lower case). Supported keywords are:

  • "terminus"
  • "undo"
  • "redo"
  • "uppercase"
  • "lowercase"
  • "space"

digits

Type digits only. Supported keywords are:

  • "terminus"
  • "undo"
  • "redo"
  • "space"
  • "dot"
  • "comma"
source

Functions of Mouse

Index

Documentation

Functions of Email

Index

Documentation

JustSayIt.Email.emailFunction
email `inbox` | `outbox`

Manage e-mails, performing one of the following actions:

  • open inbox
  • open outbox
source

Functions of Internet

Index

Documentation

JustSayIt.Internet.internetFunction
internet `search`

Navigate the internet, performing one of the following actions:

  • search: start search engine, enter "type text" mode to obtain search words from speech and then trigger the search when the keyword "search" is spoken.
source