Voice coding is the new live coding

In Feb 2025 at PyConf Hyderabad, I tried a new slide format: command-line slideshows in bash.

I’ve used this format in more talks since then:

It’s my favorite format. I can demo code without breaking the presentation flow.
It also draws interest. My setup was the top question in my PyCon talk.

In Sep 2025, at PyCon India, I extended the setup for voice typing. talkcode.sh is a Bash pipeline that:

  • uses ffmpeg to record mic into as 16 kHz mono, voice-optimized .opus
  • sends audio to Gemini via llm for transcription
  • uses awk to extract the code fence
  • uses xclip to copy the code to the clipboard
  • uses xdotool to paste it back to the original window
# Mic only, 16 kHz mono, voice filtering, fast Opus
ffmpeg -hide_banner -v error \
  -f pulse -i default \
  -ac 1 -ar 16000 \
  -af "highpass=f=100,lowpass=f=6000" \
  -c:a libopus -b:a 16k -vbr on \
  -compression_level 2 -application voip -frame_duration 60 \
  -y "$AUDIO"

# Transcribe, extract the code fence and copy to clipboard
llm -m gemini-2.5-flash -a "$AUDIO" -s "$SYSTEM_TEXT" \
  | tee /dev/tty \
  | awk 'BEGIN{f=0} /```/{f=!f; next} f{buf=buf$0"\n"} END{print buf}' \
  | xclip -selection clipboard

# Bring last window to foreground and paste from clipboard
if [ -n "${ACTIVE_WIN:-}" ]; then
  xdotool windowactivate --sync "$ACTIVE_WIN"
  sleep 0.08
  xdotool key --clearmodifiers ctrl+shift+v
fi

During the workshop, I said, “Which (judicial) bench has the longest pending cases,” and it generated a DuckDB query that, single-shot, ran correctly on the Indian High Court judgements dataset.


But LLMs are slow and break the flow. Here’s how I keep the room engaged:

  1. Dictate, don’t type. Speaking is faster and more engaging. That’s why I built this workflow.
  2. Avoid Alt-Tab. Bring the LLM into your app. Window-switching and copy-paste break focus for you and the audience.
  3. Always stream output. Narrate as it loads. | tee /dev/tty streams while piping.
  4. Answer questions while you wait. Keep a Slido Q&A open and address the top ones while waiting for the LLM.