Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Speech Recognition and TTS in less than 500kb (github.com/moonshine-ai)
475 points by petewarden 17 hours ago | hide | past | favorite | 66 comments
 help



Stt/tts systems always seem to me so promising, but I pretty much never use voice to interface with a computer. Sometimes instead of typing on my phone, I use a voice dictation. I would be keen to use voice to control Claude code, but I've always felt that the way I speak is different from the way I write good prompts.

Fishing for anecdotes here, does anyone have any good tts/stt experiences?


I (well CC and I) wrote a tts/stt pipeline for the CLI of CC. It's a lot more, immersive I guess, when I open my dev environment and it gives me a verbal walk through of what's going on.

(this inspired some more demo-y stuff I have where claude can manipulate the mouse and audit things it's built visually in conjunction with that). I'm sure this has already been wrapped up into some MCP framework, but it was fun to build it super early on and it just sort of works for me.

I don't use this in my day job, but it does feel very futuristic when I pull up my home lab.


I've always dreamed of having the ability to just talk to my computer (in the right circumstances) so I actually worked in the field for many years. The main reason I never use speech recognition today is because I have zero interest of sending recordings of my voice to the servers of some global corporations.

Running speech recognition and TTS locally is quite feasible, as projects like this one show.


If you want a local and open source option (MacOS only at the moment though), I've been happily using Keyscribe for dictation, which is built on Moonshine I believe.

https://rsperko.github.io/keyscribe/


I do a ton of coding (codex) with a tts/stt wrapper. During walks, cycling, in the car. Not every task is suited to this style of interaction, but many are. Long form codex replies are condensed, code blocks are suppressed all in the name of making it work for tts feedback. So it works best on well defined projects with guardrails, where you know the agent can perform well.

That's fantastic. I have long, winding trails near me also and one of these days I also want to start prompting a coding agent on my bike with a headset. Do you recommend any particular type of headset?

Edit: never mind, I see you already suggested the Shokz OpenComm2 in another comment. Thanks!


This is so alien to me. Why not plug into the machine matrix when out in the great outdoors enjoying sublime nature? Why not!

It's not a replacement for being outdoors, connecting with nature. It replaces indoor desk bound office work.

I can't honestly think of a case where this would be remotely useful. This goes somehow beyond vibe coding to vibe interaction, where the only feedback comes via the AI. I'd love to see a concrete example of this working practice.

This is extremely dangerous and you should stop doing it.

https://etsc.eu/tiny-proportion-of-drivers-understand-danger...


During cycling! Do you have a phone mount on your bike that you use while biking or is it all in-ear?

I have my phone in my pocket, no screen interaction is required. I use a headset (Shokz OpenComm2) with wind muff (when cycling). I made an Android app that listens for codex turn-complete or intermediate updates and plays them back to me. My answer is transcribed and pasted back to the relevant codex (tmux) session on the server (which I can select by voice) a tiny layer helps with things like /new, /plan, answer selection, etc.

... I cannot think of an activity less suitable for coding (except scuba diving)

I would die In minutes


Think long winding, quiet, dedicated cycling roads in forested areas and natural parks. Not busy roads shared with cars and lorries.

On some days, half of my promts to Copilot at work are spoken to a local whisper medium model running on an Intel ARC GPU.

I'm founder of ottex.ai, I use stt pretty much all the time when work with AI and quite often for communications to draft emails and chat messages.

I started ottex half a year ago after I tested gemini 2.5 flash native audio support. I was blown away by the quality of transcripts and decided to built an app to use it myself.

Currently the default model in the app is Gemini 3 flash, but you can connect to 9 providers and God knows how many models to play with.

I would suggest you to try this models for ai prompting:

- Gemini 3 / 3.5 flash - Soniox rtt v5 - Mistral transcribe v2 - assembly 3.5 pro


One of my side projects is a tool that lets you control your entire system with STT. It's built on Whisper and supports hot swapping custom profiles, so you can add easy commands for any software.

I intend to use it to work on low stakes vibe coding projects while I'm doing other stuff. Todays LLMs are a lot better at interpreting rambling dictation with mid-message corrections.

There are a few paid programs out there that do the same, but they made my vibe slop sense tingle and are not aimed at development.


Industry leading Interactive Voice Response systems have become very good at filling in ambiguous information from context, and modulating pronunciation to Ape emotional information.

However, being able to interact with these natural language systems in uncontrolled settings is still a fools errand. For STT, there is also regional dialect, slang, and individual differences.

Witnessing blind users hit unrecognizable reading-speeds on old Gordon 8 TTS systems was surprising. I learned people adapt to imperfect systems pretty quickly. =3


For STT, wispr flow has a generous free tier. For TTS, I have Claude read out loud what it just finished as a stop hook, so I know which claude finished up.

Quick link to the video where he demos it: https://www.youtube.com/watch?v=kMliOFYBiz4

Is that Microsoft Sam? :)

(Also, I know it's besides the point but this might be the most painful way to connect to Wifi physically possible. "Make normal everyday tasks slow, tedious and painful" is a bit of an odd choice for a product demo.)

Say, speaking of Sam, what were the memory requirements for SAM (Software Automatic Mouth) on C64. I guess they were not more than 64K? Although, the bulk here is probably for the speech recognition, not the TTS. (And this one does sound a little nicer :)

Browser demo of a reversed SAM:

https://discordier.github.io/sam/index.html


There are two Sams here, the Microsoft one and the C64 one. I don't believe there's any connection between the two other than the name.

According to [1], the weight of a modern runnable version is around 39k.

The ratio of how good it sounds compared to how much computing power it uses is ridiculous. The C64 has ballpark 3 orders of magnitude less CPU throughput as an RP2350, and the codebase uses an impressive array of tricks to do actual formant synthesis (barely) and a pretty refined form of Elovitz text to phoneme conversion. One of my favorite tricks is its up and down bouncy pitch, which is not random, but based on the opposite contour as the first formant. It's simplistic but enough to make it not sound like a robotic monotone.

I've been playing around with this some myself and SAM is an inspiration, along with other landmark systems like MITalk (predecessor to DECtalk), SP0256, and other. I believe it's possible to use modern techniques to get pretty good sounding speech in, say, 64k and 10% of the throughput of a RP2350. It's really cool to see projects like OP, especially under permissive license.

[1]: https://simulationcorner.net/index.php?page=sam


Amazing that this works. As an aside, and I appreciate this is just a demo, if the use case is to get a device to join a WiFi network - would a single or double line lcd with 3 buttons not be cheaper than 520KB?

the target rp2350 is a sub-$1 chip. a 16x2 LCD module is over $1. but more importantly, you might have this much ram sitting around unused on whatever you're building anyway.

Thanks for that ... impressive!

This is awesome. I am trying to build a full scale ASR system within 20-25MB. Now that we have Claude code to run experiments, I have started running some experiments. Promising results so far. First realization is that you can capture the nuances of speech in just 3300 embedding vectors(786d). This sequence can be decoded with a small CTC system to get text. Next experiments are on reducing the 768 dimension space into a 64D space. Thats also show some promising results. Hooking up my system so that the agent blogs the results everyday[1]. So my research "claw" setup does the experiments and posts results which I check in the morning and adjust the experiment direction as needed. Its not fully automated yet, but almost there.

[1] https://blog.trulm.com/posts/speech-as-independent-parts/


I think Google's Conformer paper is SOTA at the <30M model size, where I think they put an incredible amount of flops into a 10M param model to reach around 2% lsc clean (the whole model and RNN decoder were trained domain specific to librispeech here).

I think my small Talon models are next, around 3% lsc clean at ~28M (greedy CTC decoding, no external encoder, no LM, not trained in a domain specific way). I reached around 6.5% at 10M.

I've been working on some new baselines I want to release soon as public artifacts. This article is inspiring me to try pushing the param size down a bit. I suspect we can do large vocabulary end to end in the <5M range.


I made a little python wrapper around it to serve an HTTP endpoint that’s OpenAI/elevenlabs compatible https://github.com/clayrosenthal/bootlegger

Do you have any accuracy benchmarks?

I’ve worked in this space. TTS in a small footprint isn’t the hard part —- it’s doing it accurately that’s hard.

Although for the use cases OP is targeting, lower accuracy may be good enough!


> I’ve worked in this space. TTS in a small footprint isn’t the hard part —- it’s doing it accurately that’s hard.

This actually holds for everything in AI.


Very true!

If you look at this chart here it seems the tiny model has a WER of ~12%… not sure about the micro model:

https://github.com/moonshine-ai/moonshine#when-should-you-ch...


That's the error rate for STT, not TTS. TTS is generally easier than STT because you only need to produce one valid pronunciation and don't need to handle variation within and between individuals.

For TTS I wonder how this compares to nanotts[1] with the en-GB voice, which is sort of unreasonably good.

[1] https://github.com/gmn/nanotts


Wow, it seems like this might beat out flite for very-low-memory TTS? I ended up abandoning a project of mine because I couldn't get high enough quality or low enough memory usage out of flite, so I'm very excited to try this out.

Flite for comparison: https://github.com/festvox/flite


I installed the command line version using uv

    uv init
    uv add moonshine-voice
    uv run moonshine-voice mic --language en
super nice to be able to run it to test it like this

good job on a clear readme.md tbh


`uvx moonshine-voice mic --language en` That is even simpler.

So at that tiny 500kb size I imagine it could be compiled to web assembly, and run entirely in the browser right?

Couldn’t find a link, is that hard to do?


500k memory but not sure about disk.

This is really impressive.

If I get time, I would like to try compiling it to WASM. This would allow me to swap my robot poet’s native browser voice synthesis for it. Not sure if it is worth it, but it will be fun to play around with.

Edit: typo

[0] https://muffinman.io/bard/


Very cool. I've done TTS on a 32K Arduino but it was pretty croaky. https://youtu.be/ErGDboTpwM0

This makes me want to have a server room with 5 of these around my house and control everything that house in LabRats

This looks like an extreme point for AI-based TTS, as formant/tract modeling synths tend to be more accurate if you want TTS in a tiny amount of compute, but sound distinctly robotic.

TTS (neural diphone synth @ 16 kHz) ~1.8 MiB voice pack

This is in the realm of Microsoft Sam.


Presumably it's not, but the TTS voice in the video sounds to me more like formant synthesis than diphone - it reminds me of my DECtalk.

The project credits does mention espeak (which is formant based) as well as various other TTS projects, although it sounds like they are only using the pronunciation part of espeak, not the voice synthesis.

https://github.com/moonshine-ai/moonshine#acknowledgements


It certainly sounds similar, but seems more nimble with phonetic pronunciation in the demo.

Having it run on a pico would be pretty impressive =3

http://cmuflite.org/

https://github.com/festvox/flite


this is good to see. i also trained a stt under 500kb for sub dollar chips. it had about 20 words that it could understand(like start, stop, left, right, go, up etc) and then the spell mode where you could say the word spell and then say the individual english alphabets and close with spell. it was super fun to work on. these tend to be extremely unstable though, like confusion between p and t (at least for my accent). will have to try this one now.

Could you get people to use the NATO phonetic alphabet for the spelling part? I suppose a challenge is that many people don't know the whole thing, even if they're aware it exists.

NATO phonetic is to be understandable over a noisy radio channel, if you want just distinct sounds then Talon Voice users settled on shorter ones easier to use all the time:

    air a
    bat b
    cap c
    drum d
    each e
    fine f
    gust g
    harp h
    sit i
    jury j
    crunch k
    look l
    made m
    near n
    odd o
    pit p
    quench q
    red r
    sun s
    trap t
    urge u
    vest v
    whale w
    plex x
    yank y
    zip z

Interesting, that some words don't start with the letter they represent.

I remember someone training smart kettle to use its speaker as microphone

IIRC the Alexa enabled voice remotes also used a similarly small model though perhaps not this small


Will it be able to understand my English with an Indian accent?

The voice activity detection alone here is compelling - very useful for doing things like highlighting a speaker who's transmitting in realtime. At that rate the impact on perf will be so minimal that you could easily run it in the browser across devices.

It looks great, thank you! I'll see if I can use it for my in browser AI assistant project's ( https://aidekin.com ) voice part. It's currently using Nemotron-3.5-ASR and supertonic-3 but overall it requires 1.2gb download.

Given the tiny size of this, I wonder about possible future integration with esphome compatible hardware

https://esphome.io/


I suppose, but for home automation, esps are best for getting the audio to something more powerful. If this lets a raspberry pi do voice recognition really fast, that alone is worth it.

Voice is one of the most latency-sensitive modalities in AI. Moonshine is doing awesome stuff

Is the dataset open

Great work!

ngl, it looks incredible

very nice I love it

Thank you for this. I love your work on Curb Your Enthusiasm.

What work?

Possibly Cousin Andy? https://curb-your-enthusiasm.fandom.com/wiki/Andy_David

Played by the great Richard Kind, who my wife swears she saw on the Highline in NYC.


Probably a joke that the author looks like someone on the show? I'm puzzled as well.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: