A terminal music player written in C, built as a first dive into Linux system programming.
First project using Linux system calls —
fork,kill,signal,waitpid,setsidand more. Purely for learning, but it actually works.
- Scans
~/Musicfor.mp3files automatically - Lets you pick a song from a numbered playlist
- Plays audio via
mpg123spawned as a child process - Pause / resume with
SIGSTOP/SIGCONT - Stop and clean exit with proper
waitpidand memory cleanup - No zombie processes (
SIGCHLDignored)
gcc -Wall -o reproductor terminal_rpd.cAntes de compilar: abre
terminal_rpd.cy cambia la línea marcada conCAMBIAR_RUTAa tu carpeta de música:char *ruta = "/CAMBIAR_RUTA"; // <-- pon aquí tu ruta, ej: "/home/tu_usuario/Music"
./reproductorRequires mpg123 installed:
# Debian / Ubuntu
sudo apt install mpg123
# Alpine
apk add mpg123fork()+exec()to spawn child processessetsid()to detach the player from the terminal sessionkill()withSIGSTOP/SIGCONT/SIGKILLfor playback controlwaitpid()to reap child processes and avoid zombiessignal(SIGCHLD, SIG_IGN)as a shortcut for zombie prevention- Dynamic memory with
reallocfor a variable-length playlist opendir/readdirfor filesystem scanning