La voce — 声音
A minimal voice message component for AI chat interfaces, with SenseVoice-powered transcription and emotion detection.
Users speak → browser records → server transcribes (with emotion) → chat renders a voice bar.
- 🎙️ Browser-native recording (MediaRecorder API)
- 🌊 Real-time waveform visualization during recording
- 📝 Server-side transcription via SenseVoice (50+ languages, 15x faster than Whisper)
- 😊 Emotion detection (happy / sad / angry / neutral)
- 🎵 Playable voice bar with waveform progress and duration
- 📋 Transcript toggle ("文" button to view transcribed text)
- 💾 Draft mode: record multiple voice messages before sending
pip install funasr torch torchaudio
python server.py
# Open http://localhost:3456- Record: Click the mic button → browser uses
MediaRecorderto capture audio - Upload: Audio blob is uploaded to
/uploadendpoint - Transcribe: Server sends audio to SenseVoice model → returns text + emotion tag
- Render: Frontend displays a playable voice bar with waveform animation
- Frontend: Vanilla JS + MediaRecorder API + Web Audio API (for waveform)
- Backend: Python HTTP server + FunASR/SenseVoice
- No frameworks. No build step. Copy and run.
Built by Cu & Lunedì · cunedi.uk
MIT