惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
Simon Willison's Weblog
Simon Willison's Weblog
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
S
SegmentFault 最新的问题
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
量子位
SecWiki News
SecWiki News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
爱范儿
爱范儿
S
Secure Thoughts
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
D
Docker
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
F
Fortinet All Blogs
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
Recent Announcements
Recent Announcements
Recent Commits to openclaw:main
Recent Commits to openclaw:main
G
GRAHAM CLULEY
Recorded Future
Recorded Future
罗磊的独立博客
Forbes - Security
Forbes - Security
Security Latest
Security Latest
NISL@THU
NISL@THU
T
The Exploit Database - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
T
Tenable Blog
C
Cybersecurity and Infrastructure Security Agency CISA
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
K
Kaspersky official blog
月光博客
月光博客
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I added voice messages to my self-hosted AI agent, for free
Lucas Neves · 2026-04-28 · via DEV Community

Hello there!

I've been building a small personal AI agent called nevinho. It lives in my Discord DMs and helps me with everyday stuff. Bash commands, web searches, code questions, the usual.

After using it for a while, the friction became obvious. Typing into Discord on my phone while walking or cooking is awful. I wanted to just talk to it.

Discord already has voice messages built in. You hold a button, talk, and it sends an audio attachment. So the job was simple on paper. Receive the audio, turn it into text, feed it to the agent.

This post is the story of how I wired that up without paying for an API.

Why local instead of OpenAI's Whisper API

My first instinct was to call the OpenAI Whisper API. It works, it's accurate, it's cheap.

But this is a personal bot. Every dependency I add is one more thing that can break, expire, or cost money I forgot about. I already had API keys for the LLM. I didn't want another bill, another secret to rotate, another vendor lock.

There's also a nice principle behind nevinho: the harness should do as much as possible on my own machine. Voice felt like the perfect place to apply that.

So I went looking for something that runs locally.

Picking whisper.cpp

whisper.cpp is Georgi Gerganov's port of OpenAI's Whisper model to plain C++. It runs on CPU, no GPU needed, and the smallest model (ggml-tiny.bin) is only about 75MB.

For my use case (short voice messages, English mostly, occasional French) tiny is more than enough. Transcription on a normal laptop takes 1 to 3 seconds.

Two binaries, one model, no network calls after install. Perfect.

The pipeline

When a user sends a voice message in Discord, the bot needs to do four things:

  1. Detect that the attachment is audio
  2. Download the file
  3. Convert it to a format whisper.cpp accepts
  4. Run whisper and get the text back

The format step matters. Discord voice messages come as .ogg files. whisper.cpp wants 16kHz mono WAV. So I lean on ffmpeg to do the conversion.

Here's the core of the transcribe function:

func Transcribe(whisperDir string, audioData []byte, filename string) (string, error) {
    binary := filepath.Join(whisperDir, "whisper-cli")
    model := filepath.Join(whisperDir, "ggml-tiny.bin")

    tmpDir, _ := os.MkdirTemp("", "nevinho-voice-*")
    defer os.RemoveAll(tmpDir)

    audioPath := filepath.Join(tmpDir, filename)
    os.WriteFile(audioPath, audioData, 0644)

    // Convert to 16kHz mono WAV for whisper.cpp
    wavPath := filepath.Join(tmpDir, "audio.wav")
    ffmpeg := exec.Command("ffmpeg",
        "-i", audioPath,
        "-ar", "16000", "-ac", "1",
        "-c:a", "pcm_s16le",
        wavPath, "-y")
    ffmpeg.Run()

    // Run whisper with a 30s timeout
    ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
    defer cancel()

    cmd := exec.CommandContext(ctx, binary,
        "-m", model, "-f", wavPath,
        "--no-timestamps", "-t", "4")
    output, _ := cmd.CombinedOutput()

    return cleanWhisperOutput(string(output)), nil
}

Enter fullscreen mode Exit fullscreen mode

That's the whole thing. Two exec calls and a temp directory. No SDK, no streaming, no chunking.

Cleaning the output

whisper.cpp prints log lines mixed in with the transcription. Stuff like whisper_init_from_file_with_params: ... and system_info: .... Useful for debugging, noise for me.

So I strip them by prefix:

func cleanWhisperOutput(output string) string {
    var lines []string
    for _, line := range strings.Split(output, "\n") {
        line = strings.TrimSpace(line)
        if line == "" {
            continue
        }
        if strings.HasPrefix(line, "whisper_") ||
            strings.HasPrefix(line, "main:") ||
            strings.HasPrefix(line, "system_info:") ||
            strings.HasPrefix(line, "output_") {
            continue
        }
        lines = append(lines, line)
    }
    return strings.Join(lines, " ")
}

Enter fullscreen mode Exit fullscreen mode

Not glamorous, but it works.

Installing whisper without scaring people

The harder problem was install. Most users won't want to know what whisper.cpp is. They just want voice to work.

So nevinho setup handles the whole thing. The first time you enable voice, it:

  1. Installs ffmpeg if missing (apt, brew, dnf, apk)
  2. Tries to download a pre-built whisper-cli binary from the nevinho releases page
  3. Falls back to building from source if no pre-built binary exists for the platform
  4. Downloads the 75MB tiny model from Hugging Face

The pre-built binary is the fast path. Most people get voice in under a minute. Building from source needs cmake and a C compiler, takes a few minutes, but works on anything.

func installWhisper(whisperDir, dest string) error {
    err := downloadWhisperBinary(dest)
    if err == nil {
        return nil
    }
    fmt.Println("  No pre-built binary for this platform, building from source...")
    return buildWhisper(whisperDir, dest)
}

Enter fullscreen mode Exit fullscreen mode

This was the part I cared about most. A feature is only as good as how easy it is to turn on.

Wiring it into Discord

The Discord side is small. When a message comes in with no text but an audio attachment, transcribe it and pretend the user just typed the result.

if text == "" && len(m.Attachments) > 0 {
    for _, att := range m.Attachments {
        if isAudioAttachment(att) {
            transcribed := b.transcribeAttachment(s, m.ChannelID, att)
            if transcribed != "" {
                text = transcribed
                isVoice = true
            }
            break
        }
    }
}

Enter fullscreen mode Exit fullscreen mode

From here the rest of the agent loop runs unchanged. The voice flow doesn't care that the input came from audio. It's just text now.

One small touch: when the agent replies to a voice message, it replies as a Discord quote-reply on the original audio. That way the conversation stays visually linked.

What it costs

Zero. No API key, no per-minute charge, no monthly subscription.

The only cost is the 75MB model on disk and a few seconds of CPU per voice message. On a $5/month VPS this is nothing.

What I'd improve

The tiny model is fast but not the most accurate, especially on accents or noisy audio. Swapping in base or small is a one-line change in the setup, just a different model file. I'll probably make it configurable.

The other thing on my list is better multilingual support. The tiny model technically handles many languages, but quality drops fast outside English. I switch between English, French, and Portuguese throughout the day, and tiny struggles with that.

The bigger Whisper models (small, medium) handle that mix much better. The tradeoff is size and CPU time. small is around 460MB and a few times slower than tiny, but still fine on a normal machine. The right answer is probably to let people pick the model during setup based on the languages they actually speak.

Try it

Nevinho is open source. If you want a personal AI bot in your DMs that can listen as well as read, it takes about a minute to install:

curl -sSL https://raw.githubusercontent.com/lucasnevespereira/nevinho/main/install.sh | bash
nevinho setup
nevinho start

Enter fullscreen mode Exit fullscreen mode

Repo here: github.com/lucasnevespereira/nevinho.

Hope this gives you ideas for your own projects. If you build something similar or have feedback, feel free to open an issue or just say hi.