A terminal-based karaoke tool that removes vocals from an MP3, displays timed lyrics from an .lrc file, records your microphone while the instrumental plays, then overlays your recording onto the accompaniment and exports an MP3.
- Pick a song from a numbered list
- Runs Spleeter to generate an instrumental (
accompaniment.wav) - Plays the instrumental while:
- showing lyrics from an
.lrcfile in sync - recording your mic audio
- showing lyrics from an
- Mixes your mic recording over the accompaniment
- Saves the final result as an MP3
- Python 3.x
ffmpegavailable on PATH- Spleeter installed and working (
spleeter separate ...) - Working microphone input device
- MP3 files + matching LRC lyric files
Your project expects these folders:
mp3/— your.mp3songslrc/— your.lrclyric filesoutput_folder/— created by Spleeter (instrumental output)my_recordings_temp/— temporary WAV recordings (created at runtime)my_recordings/— final mixed MP3 output (created at runtime)
If some output folders don’t exist yet, create them:
mkdir -p my_recordings my_recordings_temp output_folderFor a song to work, the .mp3 and .lrc must have the exact same base filename.
Example:
mp3/Artist - Song Title.mp3lrc/Artist - Song Title.lrc
If the filenames don’t match exactly (same punctuation, spacing, etc.) the lyrics won’t load for the selected track.
This app expects the track name to follow this pattern:
Artist - Title
So the file should look like:
Artist - Title.mp3
Artist - Title.lrc
python -m venv venv
source venv/bin/activatepip install -U pip
pip install pydub sounddevice soundfile colorama pyfiglet numpy(If you have a requirements file, use pip install -r requirements.txt instead.)
You need ffmpeg installed and available on your PATH.
You also need Spleeter available via the spleeter command.
To make this project work cleanly, you need to modify a file inside your virtual environment after installing dependencies.
Edit this file:
venv/lib/python3.xx/site-packages/pydub/playback.py
Replace xx with your Python minor version (example: python3.10 for Python 3.10).
Find the function:
_play_with_ffplay
Then add the following code below the function definition (as a new function):
import os
def _play_with_ffplay_suppress(seg):
with NamedTemporaryFile("w+b", suffix=".wav", delete=False) as f:
PLAYER = get_player_name()
seg.export(f.name, "wav")
devnull = open(os.devnull, 'w')
subprocess.call([PLAYER,"-nodisp", "-autoexit", "-hide_banner", f.name],stdout=devnull, stderr=devnull)This suppresses ffplay output spam while the audio plays.
Put your songs in mp3/ and matching lyrics in lrc/, then run:
python karaoke.pyYou’ll get a menu of available tracks. Pick a number, then sing.
- Temporary mic recordings are written to:
my_recordings_temp/ - Final mixed MP3 files are written to:
my_recordings/
- If Spleeter hasn’t been run for a song yet, it will generate:
output_folder/<song_name>/accompaniment.wav - If you don’t hear your mic monitoring, check your OS sound input/output device settings.
- If you get errors about audio devices,
sounddeviceis usually complaining about a missing default device or mismatched channel setup.