Skip to content

A small C experiment with signals and inter-process communication. Instead of quitting on Ctrl+C, this program overrides the default SIGINT behavior to play a sound (meow.mp3). Press q + Enter to exit cleanly. Built with SDL2 and SDL2_mixer.

Notifications You must be signed in to change notification settings

rohitmane01/Meow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐱 Meow-on-Signal

A fun little C project to explore signals and inter-process communication (IPC).
This program prints a "Program is Running..." message in a loop, reacts to Ctrl+C by playing a sound, and can be exited cleanly by pressing q.


🎥 Demo Video

Watch the demo

(Click the image above to watch the video on YouTube.)

✨ Features

  • Runs continuously, printing a message.
  • Handles SIGINT (Ctrl+C) → plays meow.mp3 instead of terminating.
  • Press q + Enter to quit gracefully.
  • Uses SDL2 and SDL2_mixer for audio playback.
  • Cross-platform exploration (tested on Windows MSYS2/MinGW64).

🛠️ Requirements

  • MSYS2 (for Windows users)
  • SDL2 development libraries
  • SDL2_mixer development libraries
  • GCC compiler (mingw-w64-x86_64-gcc)

⚙️ Build & Run

Compile

gcc -o program_a program_a.c play_audio.c -lmingw32 -lSDL2main -lSDL2 -lSDL2_mixer

Run

./program_a

🎮 Usage

  • The program prints:

    Process ID: 18408
    Press 'q' + Enter to quit
    Press Ctrl+C to wake up the cat
    Program is Running...
    
  • Press Ctrl+C → Plays meow.mp3 🐱

  • Press q + Enter → Exits cleanly.


📂 Project Structure

.
├── program_a.c        # Main program (signal handling + message loop)
├── play_audio.c       # Audio utility functions
├── play_audio.h       # Audio function declarations
├── meow.mp3           # Example sound file (not included in repo)
└── README.md

📖 MSYS2 Setup on Windows

Click to expand setup instructions

1. Install MSYS2

2. Open MSYS2 MinGW64 terminal

  • Start Menu → search MSYS2 MinGW64

  • Your prompt should look like:

    username@PC MINGW64 ~
    

3. Update packages

pacman -Syu

(Close and reopen MSYS2 MinGW64 terminal if asked.)

4. Install dependencies

pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_mixer

5. Navigate to your project

cd /c/projects/githubprojects/Meow/program_a

6. Compile & Run

gcc -o program_a program_a.c play_audio.c -lmingw32 -lSDL2main -lSDL2 -lSDL2_mixer
./program_a

🙏 Credits

This project was inspired by hands-on experiments with signals and SDL2. It is adapted from the following repository:

Original Repository Template:


About

A small C experiment with signals and inter-process communication. Instead of quitting on Ctrl+C, this program overrides the default SIGINT behavior to play a sound (meow.mp3). Press q + Enter to exit cleanly. Built with SDL2 and SDL2_mixer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages