VoiceGem

How to dictate a Python function definition and its body

Python is the language that dictates with the least cleanup. VoiceGem turns “def snake case load config open paren path colon str close paren colon” into def load_config(path: str): exactly as written, because Python's conventions match the attach flags of every character involved.

A twelve-word def line takes roughly 14 seconds to type and roughly 4.4 seconds to say. (sources: Dhakal, Feit, Kristensson & Oulasvirta, “Observations on Typing from 136 Million Keystrokes”, CHI 2018, 168,000 participants, 136 million keystrokes; Yuan, Liberman & Cieri, “Towards an Integrated Understanding of Speaking Rate in Conversation”, Interspeech 2006, 2,438 American English telephone conversations (Switchboard corpus). The speech figure is conversational rate, not a measured dictation rate — no such measurement exists.)

What lands in your editor
def load_config(path: str, strict: bool = False):

This tool runs entirely in your browser. Nothing you type is sent anywhere, stored, or logged.

Step by step

  1. 1

    Say “def” then a casing command

    Speak “def snake case load config”. The keyword passes through untouched because it is not in the lookup table, and the casing command joins the two following words.

  2. 2

    Give each parameter its own casing command

    Say “snake case” again inside the brackets. A casing run ends at the open paren, so a multi-word parameter name needs a fresh command.

  3. 3

    Close with “close paren colon”

    Say both phrases together. The closing bracket and the colon each attach left, so the def line ends exactly as Python formats it.

  4. 4

    Say “new line tab” for the body

    Speak the whitespace commands to open the indented block. VoiceGem emits one tab per phrase and never infers depth, so a nested block needs the command twice.

Python is the language VoiceGem dictates with no cleanup at all

Every character a Python signature needs has attach flags that match Python's own conventions. The colon attaches left, which is right for both a type hint and a block opener; the brackets attach tightly; snake_case comes from a casing command rather than from the underscore symbol; and Python has no braces, no semicolons and no generics to space wrongly.

The contrast with Java and Go is the useful part. A Java signature dictated through the Deterministic Pass needs its generics closed up and a Go signature needs its pointer stars closed up, while a Python def line arrives ready to run. Language choice changes how much dictation is worth, and Python is where it is worth most.

Where the manual way breaks

A one-parameter def line is quick to type and Python's syntax is deliberately light. Short functions are not the case for dictation.

Long parameter lists with defaults and hints are where the underscore count climbs. Three snake_case parameters with type hints and default values means six underscores, three colons, two commas and an equals, and every underscore is a Shift-hyphen. Dictating the signature in VoiceGem replaces all of that with three casing commands and the words you already had.

Doing this somewhere else? speech-to-code converter, with nothing to install, the same thing for dictating Python docstrings, how dictating Bash functions works, or dictating Go functions, step by step.

Common questions

No. Every character involved has VoiceGem attach flags that match Python's conventions, so the line arrives ready to run.

Say “at sign snake case require auth new line def”. The at sign binds rightward and the line break is a whitespace command in the same pass.

Say “new line tab”. One tab is emitted per phrase, so a nested block needs the command said twice.

Dictate a def line with three hinted parameters and run the result.

Open the tool