Background Tracks is a customizable ambient sound mixer built with Python and Tkinter. It lets you mix and loop natural soundscapes — rain, birds, stream, campfire, beach, night — with per-track volume sliders and a dark-mode UI with image previews.
Perfect for focus, relaxation, or sleep.
📦 Windows release: Download the prebuilt app
- 🎚 Mix up to 6 ambient categories simultaneously
- 🎵 Loop any MP3 track from each category
- 🖼 Dark mode UI with high-resolution image previews
- 🔊 Per-track volume control
▶️ Individual play / stop buttons for each sound- ⏹ Stop All button to silence everything in one click
- 📂 Auto-discovers all
.mp3files inSounds/<category>/ - 💾 Packaged into a single .exe for easy use on Windows
- NEW: Configurable folders via CLI (
--sounds-dir,--images-dir) - NEW: Master volume flag (
--master-volume) - NEW: Window-close cleanup wired up properly (no orphaned audio threads)
Nature-sounds/
├── Main.py
├── requirements.txt
├── Sounds/
│ ├── 01_bird/ *.mp3
│ ├── 02_beach/ *.mp3
│ ├── 03_night/ *.mp3
│ ├── 04_rain/ *.mp3
│ ├── 05_stream/ *.mp3
│ └── 06_campfire/ *.mp3
└── Images/
├── birds.jpg
├── beach.jpg
├── night.jpg
├── rain.jpg
├── stream.jpg
└── campfire.jpg
The category folders use the prefix 01_, 02_, … to keep them in display order.
- Python 3.10+
pygame— audio playbackPillow (PIL)— image handlingTkinter— GUI
pip install -r requirements.txtDefault:
python Main.pyCustom directories and master volume:
python Main.py --sounds-dir Sounds --images-dir Images --master-volume 0.6| Flag | Default | Description |
|---|---|---|
--sounds-dir |
Sounds |
Folder containing per-category MP3 subfolders |
--images-dir |
Images |
Folder containing per-category preview images |
--master-volume |
0.5 |
Initial volume for every track (0.0 – 1.0) |
| Action | How |
|---|---|
| Pick a track | Use the dropdown in each category card |
| Play | Click ▶ Play Track |
| Stop | Click ⏹ Stop Track |
| Adjust volume | Drag the Volume slider |
| Silence everything | Click ⏹ Stop All at the bottom |
| Quit | Close the window — audio cleans up automatically |
pip install pyinstaller
pyinstaller --noconfirm --windowed --add-data "Sounds;Sounds" --add-data "Images;Images" Main.pyThe bundled app appears in dist/Main/.
| Issue | Fix |
|---|---|
| No sounds available in a category | Drop one or more .mp3 files into Sounds/<category>/ |
| Image previews missing | Confirm Images/<name>.jpg exists for each category — file names must match the IMAGE_MAP dictionary |
| Crackling / stutter | Lower the master volume or close other audio apps |
| App won't close cleanly | The WM_DELETE_WINDOW protocol now stops audio and quits pygame on close |
This project is licensed under the MIT License. You are free to use, modify, and distribute this software provided that attribution is given to CS42.org as the original source.