Speech Recognition and TTS in less than 500kb

(github.com)

387 points | by petewarden 4 days ago

23 comments

  • almogo 18 minutes ago
    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?

  • clayhacks 8 hours ago
    I made a little python wrapper around it to serve an HTTP endpoint that’s OpenAI/elevenlabs compatible https://github.com/clayrosenthal/bootlegger
  • sgt 4 days ago
    Quick link to the video where he demos it: https://www.youtube.com/watch?v=kMliOFYBiz4
    • JSR_FDED 1 hour ago
      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?
      • pxx 1 hour ago
        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.
    • 8bitsrule 4 hours ago
      Thanks for that ... impressive!
  • nutanc 1 hour ago
    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/

    • lunixbochs 12 minutes ago
      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.

  • jedberg 8 hours ago
    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!

    • amelius 8 hours ago
      > 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.

    • kamranjon 8 hours ago
      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...

      • yorwba 7 hours ago
        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.
  • senkora 8 hours ago
    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

  • smcameron 7 hours ago
    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

  • orliesaurus 8 hours ago
    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

    • pwgawron 7 hours ago
      `uvx moonshine-voice mic --language en` That is even simpler.
  • gitgud 5 hours ago
    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?

    • hahahaa 5 hours ago
      500k memory but not sure about disk.
  • t0mpr1c3 7 hours ago
    Very cool. I've done TTS on a 32K Arduino but it was pretty croaky. https://youtu.be/ErGDboTpwM0
  • 1vuio0pswjnm7 2 hours ago
  • userbinator 6 hours ago
    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.

    • HarHarVeryFunny 4 hours ago
      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

  • stfurkan 8 hours ago
    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.
  • dwa3592 7 hours ago
    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.
    • schoen 2 hours ago
      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.
    • NooneAtAll3 7 hours ago
      I remember someone training smart kettle to use its speaker as microphone
    • laidoffamazon 6 hours ago
      IIRC the Alexa enabled voice remotes also used a similarly small model though perhaps not this small
  • jjcm 6 hours ago
    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.
  • walrus01 5 hours ago
    Given the tiny size of this, I wonder about possible future integration with esphome compatible hardware

    https://esphome.io/

    • KennyBlanken 4 hours ago
      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.
  • nserrino 4 hours ago
    Voice is one of the most latency-sensitive modalities in AI. Moonshine is doing awesome stuff
  • irfan_99 6 hours ago
    Is the dataset open
  • sgt 4 days ago
    Great work!
  • 0xnyn 9 hours ago
    ngl, it looks incredible
  • irfan_99 6 hours ago
    very nice I love it
  • zarmin 9 hours ago
    Thank you for this. I love your work on Curb Your Enthusiasm.