Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Terminal Reproductor

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, setsid and more. Purely for learning, but it actually works.

What it does

  • Scans ~/Music for .mp3 files automatically
  • Lets you pick a song from a numbered playlist
  • Plays audio via mpg123 spawned as a child process
  • Pause / resume with SIGSTOP / SIGCONT
  • Stop and clean exit with proper waitpid and memory cleanup
  • No zombie processes (SIGCHLD ignored)

Build

gcc -Wall -o reproductor terminal_rpd.c

Usage

Antes de compilar: abre terminal_rpd.c y cambia la línea marcada con CAMBIAR_RUTA a tu carpeta de música:

char *ruta = "/CAMBIAR_RUTA";  // <-- pon aquí tu ruta, ej: "/home/tu_usuario/Music"
./reproductor

Requires mpg123 installed:

# Debian / Ubuntu
sudo apt install mpg123

# Alpine
apk add mpg123

What I learned

  • fork() + exec() to spawn child processes
  • setsid() to detach the player from the terminal session
  • kill() with SIGSTOP / SIGCONT / SIGKILL for playback control
  • waitpid() to reap child processes and avoid zombies
  • signal(SIGCHLD, SIG_IGN) as a shortcut for zombie prevention
  • Dynamic memory with realloc for a variable-length playlist
  • opendir / readdir for filesystem scanning

About

Terminal music player in C. Fork, signals, dynamic memory.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages