Typing + voice, voice + typing; dual-channel awesomeness with Emacs
| emacs, speech-recognitionThis post is for five types of people:
- The tiny group ofq Emacs users exploring dictation and voice control: let's bounce ideas around and see how far we can take this
- Emacs users who are curious about speech: there are plenty of non-Emacs dictation tools like OpenWhispr and Superwhisper, but it might be worth the effort to make Emacs the center of your speech workflow
- People who use dictation and voice control with other editors (Cursorless on VS Code, etc.): borrow ideas and share what you've come up with
- People who haven't checked on the state of local speech recognition and who might be pleasantly surprised by what it can do these days
- Me, so I can think about the things I want to experiment with and prioritize what I want to squeeze into these last two weeks before EmacsConf (aaah!)
Dictation is a tap away on Windows and macOS. If you're on Linux or if you're looking for something other than whatever's built into the operating system, tools like OpenWhispr are easy to install. Different Linux distros are working on integrating dictation: Omarchy has Superwhisper, Ubuntu is working on dictation with Project Myna. OpenAI, Claude, and Gemini all have conversational interfaces so you can chat with a large language model. Most of the tools I've seen start with dictation. Some tools offer LLM-based rewriting to clean up filler words and false starts. You can edit, reformat, translate, and revise. Tools like Dragon and Talon Voice offer voice control and integrate into more applications.
There are any number of providers that would happily sell you a subscription for a dictation service with a cool demo, but you can get surprisingly decent results from free open-weight models that you can run on your own computer without a GPU and without cloud processing. I use sachac/whisper.el and phony with orukeet on a Lenovo P52 laptop (entirely on my CPU) from 2018. I use Kokoro for speech synthesis. Sometimes I toggle speech recognition on and off with a keystroke, sometimes I switch between command and dictation mode, and sometimes I just leave it running in the background, using Silero voice activity detection to segment it by silences. It does reasonably well. If you're philosophically opposed to large language models trained in massive data centers on enormous quantities of scraped data, you are not cut out of this game either. If you're open to more classical approaches like Vosk or CMU Sphinx, you might still be able to get voice control with a set of commands.
I've been experimenting with Emacs as the core of my speech recognition system. You might be wondering what a 50-year-old text editing program has to do with speech recognition. It's probably the most programmable piece of software around. Over the years, people have built so much on top of it. People have added task managers, note archives, email clients, web browsers, media players, and more. I think it offers some interesting possibilities that other people might not have much of an opportunity to explore. There are a bunch of us now experimenting with this, and before our meetup tomorrow, I wanted to think through the topic so that I can come up with more ideas based on things that are working well and share what I've been learning with other people.
There are three main topics I want to explore that might be at a bit of an interesting distance from the typical kinds of dictation that other tools offer:
- No silos: taking advantage of what Emacs can offer
- Typing + voice: using voice as an additional channel
- Voice + other methods: capturing, editing and restructuring ideas
No silos
One of the things I love about doing my speech recognition through Emacs is that it can take advantage of all the data and functionality that I already have. Here are some examples of how effective it is when you don't have to deal with different applications for different features.
Correction
Speech recognition isn't 100% accurate. A good speech recognition tool makes it easy to define a dictionary that influences how words get recognized. For example, I refer to "Emacs" far more often than I refer to "IMAX." I don't want to define this dictionary multiple times for dictation and spell checking and other things that I need to do with text. I want to fix misrecognized words once and have that available everywhere: when I'm dictating to my computer, when I'm automatically transcribing recordings from my phone, when I'm editing the transcripts of other people's presentations.
Bookmarks
I want to be able to open bookmarks quickly. I can use "open …" to open one of my favourites in the foreground, and "background open …" to open it without changing focus. I can use "web scroll" to scroll the browser window without shifting to it, and I can click with "web click …". I can configure some links to open in Firefox and some links to open in Chrome. This uses a list of favourites that I can also use when writing blog posts, Markdown, Mastodon toots, and e-mails. I can insert a link with completion. I can even select some plain text (ex: "EasyEffects") and use my keyboard shortcut to automatically link it to the matching favourite. I can save a link right from my blog post drafts with sacha-org-favorite-save-link. And I'm not limited to websites. I can run any kind of code or custom link through the same mechanism. For example, I can say "open schedule draft" to open the draft schedule for this year's EmacsConf as an Org mode file and an SVG. I don't have to manage different stores of data.
Integration
My voice commands have access to anything my Emacs has access to, which is a lot. When I tell my computer to take a note or add a task, it can put it in the same Org mode file that's part of my daily routines. When I'm trying to resynchronize audio and video in a recording, I can use "from the top" to restart the video player and jump to the first subtitle that I've narrowed my focus on.
Malleability
It's super easy to tweak my speech recognition system. I can add new commands, change their behaviour, or debug their internals on the fly.
Typing + voice
I still type my code. I haven't quite gotten the hang of hands-free coding yet, although a lot of people with repetitive stress injuries have figured out things that work really well for them like Emacslisten or Cursorless.
Voice gives me an additional channel that I can use to keep my fingers and my focus on one thing, while offloading the inevitable distractions to something else that can keep track of it for me. When I'm typing some code and an idea occurs to me, I can say "remind me next week to …" and the audio feedback reassures me that it's saved and I don't need to let it occupy my brain. When I'm stuck because I need to look something up, I can say "look up …" and my browser searches it for me in the background without stealing my focus. I love being able to say "let's go live" to start streaming on YouTube and "over and out" to stop streaming, even when OBS is buried under other windows on my laptop screen.
I like using voice commands to create natural shortcuts for the things that I don't do frequently enough to dedicate and memorize a keyboard shortcut for. It feels natural to use voice to expand snippets and call commands.
When I'm trying to figure out a bug or I'm thinking through a new feature, I can talk out loud and do some rubber ducking, and the notes are there so that I can go back over them later. Misrecognized words are not a problem because if I capture enough context for myself, I can usually figure it out, and I have the recording that I can go back to. When I get interrupted, my notes are there to help me pick things up again. For this, it really helps to be able to dictate somewhere other than at my cursor, and to integrate into all the other things that I do.
I prefer using a deterministic grammar to figure out my voice commands so that I have a better sense of what's going to happen. It's also pretty fast, and I can do everything locally.
I think this group of ideas is about offloading things using a secondary channel so that I can keep thinking about something without having to make a context switch. Voice is great for that because I don't even have to move my fingers or rearrange my windows.
For coding, it should be pretty straightforward to add some voice commands that reload the web page or rerun the last test. I should also be able to come up with commands to arrange my windows the way I want them. I just haven't gotten around to implementing those yet, but I've saved the TODOs so that I can focus on getting this post out the door.
Voice + typing and other methods
When I'm writing a blog post like this, it's pretty natural to use dictation because there aren't that many weird things that are hard to say. I type at about 100 words per minute. I talk at about 210 wpm if I'm doing a full-on info dump. I'm much slower at either when I actually have to think about what I want to say. (I dictated+typed this post at about 26 words per minute.) Talking helps me get the gist of the idea out of my brain before I can forget it. I also like how, when I'm streaming or recording a video, having dictation means that I don't have to explain things out loud and try to type at the same time. These are pretty normal benefits that you can get with whatever dictation tool you choose, so let's go into some of the more Emacs-y things.
For writing, I find myself shifting to getting the bulk of the ideas in through dictation rather than typing. I still prefer to edit my own text instead of having a large language model rewrite it for me. Here, Emacs's strengths as a proper text editor really come into play. Org mode makes it so easy to manage text. I've set up my dictation so that it's automatically split up into one sentence per line. This makes each sentence easy to scan. In an Org mode list, my dictation switches to automatically inserting new list items at the same level. In a comment, it continues the comment. Org mode shortcuts make it easy to move sentences and paragraphs around, reorganize lists, and move entire subtrees. I can change between lists and paragraphs, between paragraphs and one sentence per line, and between comments and code.
I can separate my voice cursor from my typing cursor with a command like "voice mark", which tells the computer where I want new text to go in. ("Voice clear" resets it.) Then I can use the keyboard to move around and do some edits at the same time. I can even switch to a different file to grab a link or copy some text.
Voice is also handy for switching things from one medium or another. For example, I start many of my blog posts as sketch notes, and voice lets me flesh out the idea in the process of getting it into my computer as a draft. It does take a little bit of correction, but so would optical character recognition, even with an AI.
Having the ability to shift back and forth between voice and typing means that I can do other things with my hands. I have some fidget toys and a 5-pound weight near my laptop. I can stand up and stretch. It's nice to have more flexibility.
I'm still practising formulating my sentence all the way through before saying it, or at least speaking in more comprehensible chunks. I often have lots of pauses and false starts. Speaking more fluidly is a good life skill though, and it'll help me with making videos and talking to other people too.
I think this group of ideas is about using voice as an input method and finding better ways to work with the raw material. I'm thinking about voice commands that I might like to use for editing. A number of other people have already started experimenting with those, like cursorfree and earwig. I think it's mostly a matter of picking the commands that I want and getting the hang of using them. I'm also curious about using voice to sort ideas into different piles. Like the way that I categorize lots of links for Emacs news every week. I experimented with using voice for categorizing those before, and I think it might be possible to generalize it so that I can write in a less linear way. I can imagine brain dumping a whole bunch of points and then grouping them into the introduction, different supporting areas, and the conclusion.
Wrapping up
People are already finding basic dictation useful, and voice control is also pretty mature. I'm curious about the stuff that doesn't scale, the things you can build when you have a super personalized setup where you aren't limited to a small set of features that the developers have anticipated. My setup is nowhere near mass market. I'm amazed that a few people have actually been able to scavenge enough from it to get things running on their systems.
None of these things are really revolutionary. They're probably not even really good reasons to switch to Emacs if you're already comfortable with something else like Neovim or VS Code. But I love being able to make these tiny tweaks to the way I work with my computer, and given my experience with Emacs, I know they'll accumulate. I'm looking forward to seeing what we can figure out together.


