Case Study

Multilingual Audio Processing Platform

Built for a language education company under NDA. All technical details and metrics are accurate. Happy to discuss the implementation in detail.


Navigation

OverviewBackend & AI →Frontend & UX →
CurrentSignal processing, ML, LLMReact, Web Audio, UX

Challenge

A language training provider needed to process bilingual exam recordings containing multiple speakers. Each 10-15 minute audio file contained:

  • 33 beep signals marking segment boundaries
  • 3 speakers: examiner, candidate, and narrator
  • Code-switching: Chinese-English in single utterances
  • 28 segments to be extracted and labeled

Manual processing took 2+ hours per file and was error-prone.

Requirements

  • Separate mixed-role audio into individual speaker segments
  • Support Chinese-English code-switching within segments
  • Achieve 100% accurate segmentation (zero tolerance for errors)
  • Enable quick review, editing, and bulk export
  • Keep per-file cost under $1.00

Solution

End-to-end audio intelligence pipeline combining:

  1. Signal Processing — Frequency analysis for beep detection
  2. Speaker Diarization — ML-based role identification
  3. Multilingual Transcription — Cloud ASR with local fallback
  4. LLM Validation — Role classification and quality checks
  5. Interactive Review — Waveform editing with real-time clipping

System Architecture

┌──────────────────────────────────────────────────────────────┐
│                       Input Layer                             │
├──────────────────────────────────────────────────────────────┤
│  Upload: .mp3 audio (10-15 min) + .docx script               │
│  Validation: Quick Whisper check, format verification        │
└───────────────────────────┬──────────────────────────────────┘
                            ↓
┌──────────────────────────────────────────────────────────────┐
│                   Processing Pipeline                         │
├──────────────────────────────────────────────────────────────┤
│                                                               │
│  1. Beep Detection ─────────────→ 33 boundary markers        │
│     └─ Frequency analysis @ 1000Hz                           │
│     └─ Cross-correlation matching                            │
│     └─ Result: 100% accuracy (33/33)                         │
│                                                               │
│  2. Speaker Diarization ────────→ 3-class classification     │
│     └─ PyAnnote.audio pretrained model                       │
│     └─ Segment-level speaker IDs                             │
│     └─ Result: 95%+ role identification                      │
│                                                               │
│  3. Transcription ──────────────→ Bilingual text             │
│     └─ AssemblyAI (primary, 95%+ accuracy)                   │
│     └─ Whisper (fallback, local)                             │
│     └─ Language detection per segment                        │
│                                                               │
│  4. LLM Analysis ───────────────→ Role validation            │
│     └─ Claude Sonnet 3.5                                     │
│     └─ Role: examiner / candidate / narrator                 │
│     └─ Script matching verification                          │
│                                                               │
│  5. Segment Matching ───────────→ Script alignment           │
│     └─ Fuzzy text matching                                   │
│     └─ Timestamp correlation                                 │
│     └─ E-C pairing logic                                     │
│                                                               │
│  6. Audio Clipping ─────────────→ 28 segments                │
│     └─ ffmpeg precise extraction                             │
│     └─ Metadata JSON generation                              │
│                                                               │
└───────────────────────────┬──────────────────────────────────┘
                            ↓
┌──────────────────────────────────────────────────────────────┐
│                      Output Layer                             │
├──────────────────────────────────────────────────────────────┤
│  28 audio segments (.mp3)                                     │
│  Metadata file (segments.json)                               │
│  Interactive review UI                                        │
└──────────────────────────────────────────────────────────────┘

Results

Performance Metrics

MetricBeforeAfterImprovement
Processing Time2+ hours<3 minutes40x faster
Segmentation AccuracyVariable100% (33/33)Deterministic
Role ClassificationManual95%+ automatedML-powered
Manual Steps15+0Fully automated
Cost per FileStaff time<$0.50Scalable

Cost Breakdown

ComponentCostNotes
AssemblyAI Transcription~$0.3610-min audio @ $0.015/min
Claude LLM Analysis~$0.10~3K tokens @ $3/M
Compute (local)~$0.00Self-hosted
Total<$0.50Per file

Accuracy Validation

ComponentMetricValueValidation Method
Beep DetectionRecall100%33/33 manual count
Beep DetectionPrecision100%0 false positives
Speaker DiarizationF1 Score0.92PyAnnote benchmark
Transcription (EN)WER5.2%AssemblyAI reported
Transcription (ZH)CER8.1%AssemblyAI reported
LLM ValidationAgreement92%Human review baseline

Tech Stack

Backend & AI

TechnologyPurposeVersion
PythonRuntime3.11
FastAPIWeb framework0.109+
PyAnnote.audioSpeaker diarization3.1
AssemblyAITranscription API-
Claude SonnetLLM validation3.5
ffmpegAudio processing6.0+
pydubAudio manipulation0.25+

Frontend & UX

TechnologyPurposeVersion
Next.jsFramework15
ReactUI library19
TypeScriptType safety5.3+
wavesurfer.jsWaveform viz7.8+
Web Audio APIClient clipping-
Ant DesignUI components5.15+

Infrastructure

TechnologyPurpose
VercelFrontend hosting
Neon PostgreSQLDatabase
Cloudflare TunnelSecure access
AWS CognitoAuthentication

Explore Technical Deep Dives

Want to understand how each component works?

Backend & AI Deep Dive →

  • Signal processing: How beep detection achieves 100% accuracy
  • Speaker diarization: PyAnnote model configuration and tuning
  • Multilingual transcription: Handling Chinese-English code-switching
  • LLM integration: Prompt engineering for role classification

Frontend & UX Deep Dive →

  • React architecture: 5-step wizard with state persistence
  • Waveform editing: wavesurfer.js integration patterns
  • Client-side audio: Web Audio API for zero-latency clipping
  • UX decisions: E-C paired layout for efficient review

Reusable Solutions

This project demonstrates capabilities applicable to:

IndustryUse Case
🎙️ Podcast ProductionMulti-speaker segmentation, transcription
📞 Call CentersAgent/customer separation, quality analysis
🎓 EducationLecture transcription, speaker attribution
🏛️ Legal/ComplianceDeposition processing, speaker ID
🌐 LocalizationMultilingual content extraction

Each technical component is documented as a standalone solution:


Questions?

This project is under NDA, but I'm happy to discuss:

  • Technical implementation details
  • Architecture decisions and tradeoffs
  • Performance optimization strategies
  • Similar solutions for your use case

Get in Touch →