A lightweight, fully local pipeline for transcribing music audio into timestamped lyrics using OpenAI Whisper — no API keys, no data upload, no cost. Built as a personal exploration of vibe coding: deploying an open-source ML model end-to-end without a traditional engineering background.
Takes any audio file (.m4a, .mp3, .wav, etc.) as input Transcribes speech/vocals using OpenAI's Whisper ASR model (run locally) Outputs a .lrc file with line-level timestamps, ready for any LRC-compatible music player All processing happens on your machine — audio never leaves your device
Most transcription tools send your audio to a remote server. For music content pipelines — where licensing and data sovereignty matter — local inference is the only viable approach. This pipeline uses faster-whisper, a CTranslate2-optimised reimplementation of Whisper that runs efficiently on CPU, making it accessible without GPU hardware.
- macOS (tested on macOS Tahoe 26)
- Python 3.11
- ffmpeg
Install ffmpeg on Mac:
brew install ffmpegpip3 install faster-whisperpython3 -c "
from faster_whisper import WhisperModel
model = WhisperModel('small', device='cpu')
segments, _ = model.transcribe(
'your_audio_file.m4a',
language='zh' # change to your target language
)
with open('output.lrc', 'w', encoding='utf-8') as f:
for segment in segments:
minutes = int(segment.start // 60)
seconds = segment.start % 60
f.write(f'[{minutes:02d}:{seconds:05.2f}]{segment.text.strip()}\n')
print('Done — output saved to output.lrc')
"Replace your_audio_file.m4a with your audio path and set language to your target language code (e.g. zh, en, vi, id).
The pipeline generates standard .lrc format:
[00:03.20] lyrics
[00:08.45] lyrics
[00:13.10] lyrics
Compatible with most music players, karaoke apps, and lyrics display systems.
| Model | Size | Speed | Accuracy | Best for |
|---|---|---|---|---|
tiny |
~75MB | fastest | lowest | quick drafts |
small |
~500MB | fast | good | general use ✅ |
medium |
~1.5GB | moderate | better | production |
large-v3 |
~3GB | slow | best | high accuracy needs |
For multilingual music content, small offers the best speed/accuracy tradeoff.
Whisper supports 99 languages natively, including:
- Chinese (
zh) - English (
en) - Vietnamese (
vi) - Indonesian (
id) - Thai (
th) - Japanese (
ja) - Korean (
ko) - Malay (
ms)
No per-language fine-tuning required — zero-shot multilingual transcription out of the box.
- Music platforms: batch-generate localised lyrics for multilingual catalogues
- Content operations: automate lyrics ingestion pipelines at scale
- Research: analyse vocal patterns or lyrics across large audio datasets
- Personal: generate synced lyrics for your own music library
- Accuracy varies with audio quality, background music volume, and vocal clarity
- Not optimised for heavily produced tracks where vocals are mixed low
smallmodel may struggle with strong accents or dialect-heavy speech — usemediumorlarge-v3for higher accuracy requirements
This project was built as part of an exploration into vibe coding — using AI-assisted iteration to deploy an ML pipeline end-to-end without a formal engineering background. The goal was to close the loop independently: from problem identification, to tool selection, to local deployment and output validation.
The underlying use case comes from real-world music content operations: at scale, manual lyrics localisation is a significant bottleneck. Automating it with a locally-deployed ASR model eliminates per-song cost, removes external data dependencies, and enables throughput that manual workflows cannot match.
- faster-whisper — optimised Whisper inference
- OpenAI Whisper — underlying ASR model
- Python 3.11
- ffmpeg
MIT — do whatever you want with it.
Contributions, issues, and forks welcome.