A simple, local sound player website for managing and playing multiple audio files with advanced controls.
- β¨ Simple UI optimized for desktop use
- π¦ Multiple sound packs: Switch between different sound collections with the dropdown selector
- π΅ Multiple playback modes: Play exclusively (stop others) or additively (mix sounds)
- βΈοΈ Full control: Play, pause, and stop individual sounds
- π Loop control: Set per file in JSON or toggle in UI
- π Volume control: Global volume + individual volume per sound
- π Stop all: Quick button to stop all playing sounds
- πΎ Pack-specific settings: Each sound pack remembers its own volume and loop settings
- π Pack discovery: Automatically detects available sound packs in the packs/ directory
- π± Local files: Works completely offline with local audio files
Due to browser CORS security restrictions, you must run a local web server. You cannot simply open index.html directly in your browser.
-
Start a local web server in the
sound-tapdirectory:# Using Python 3 (most common) python3 -m http.server 8000 # Using Python 2 (if Python 3 not available) python -m SimpleHTTPServer 8000 # Using Node.js (if installed) npx http-server # Using PHP (if available) php -S localhost:8000
-
Open in browser: Visit http://localhost:8000
-
Add your sound files to the
sounds/directory- Supported formats: MP3, WAV, OGG, M4A
- Any audio format supported by your browser
β οΈ Note: Audio files are git-ignored, so add your own files locally
-
Configure sound packs in the
packs/directory:- Multiple JSON files are supported for different sound collections
- Example
packs/sounds.json:
{ "globalVolume": 80, "sounds": [ { "name": "My Cool Sound", "file": "sounds/my-sound.mp3", "loop": false, "volume": 80 }, { "name": "Background Music", "file": "sounds/background.wav", "loop": true, "volume": 60 } ] }
βΆοΈ Play (Stop Others): Stops all other sounds and plays this one- β Play (Add): Plays this sound while keeping others running
- βΈοΈ Pause: Pauses the sound (can resume from same position)
- βΉοΈ Stop: Stops and resets the sound to beginning
- π Loop: Toggle whether the sound should loop when it ends
- π Volume:
- Global Volume: Affects all sounds (master volume control)
- Individual Volume: Per-sound volume that combines with global volume
- π Stop All: Stops all currently playing sounds
Each sound tile shows its current status through background color changes:
- White background: Ready or playing
- Light gray: Loading
- Light yellow: Paused
- Light red: Error (file not found or other issues)
sound-tap/
βββ index.html # Main website file
βββ style.css # Styling
βββ script.js # JavaScript functionality
βββ packs/ # Sound pack configurations
β βββ sounds.json # Default sound pack
β βββ ambient.json # Ambient sounds pack
β βββ sounds-effects.json # Sound effects pack
β βββ sounds copy.json # Alternative sound pack
βββ .gitignore # Git ignore rules (excludes audio files)
βββ sounds/ # Directory for your audio files (git-ignored)
β βββ .gitkeep # Keeps directory in git
β βββ Artesia.mp3 # Your audio files (not in git)
β βββ file1.mp3 # Your audio files (not in git)
β βββ Pop.m4a # Your audio files (not in git)
βββ README.md # This file
Sound pack JSON files in the packs/ directory define your available sounds. You can have multiple packs and switch between them in the UI:
{
"globalVolume": 80,
"sounds": [
{
"name": "Display name for the sound",
"file": "sounds/filename.mp3",
"loop": true or false,
"volume": 80
}
]
}- globalVolume: Master volume level (0-100, defaults to 80 if not specified) - Changes saved to localStorage!
- name: Display name shown in the UI
- file: Path to the audio file (relative to the website)
- loop: Whether the sound should loop by default - Changes saved to localStorage!
- volume: Default volume level (0-100, defaults to 80 if not specified) - Changes saved to localStorage!
- Initial load: Values from
sounds.jsonare used as defaults - User changes: Any volume or loop adjustments are saved to browser's localStorage
- Next session: localStorage values override JSON defaults
- Reset to defaults: Clear localStorage to return to JSON settings
The final volume for each sound is calculated as: Global Volume Γ Individual Volume
For example:
- Global Volume: 80%
- Individual Volume: 60%
- Final Volume: 80% Γ 60% = 48%
This allows you to:
- Use global volume as a master control
- Set individual sounds relatively quieter/louder
- Quickly adjust all sounds together with global volume
- Built with vanilla HTML, CSS, and JavaScript
- Uses HTML5 Audio API for sound playback
- Responsive design (works on smaller screens too)
- No external dependencies
- Completely client-side (no server required)
Works in all modern browsers that support:
- HTML5 Audio API
- ES6+ JavaScript features
- CSS Grid and Flexbox
- Navigate to the
sound-tapdirectory - Start the web server:
python3 -m http.server 8000 - Open http://localhost:8000 in your browser
- Add your audio files to the
sounds/folder - Create or update JSON files in the
packs/directory with your sound configurations - Use the sound pack dropdown to switch between different collections
- Use global volume to control overall loudness, individual sliders for balance
β¨ Smart Persistence Features:
- JSON file provides defaults - Set your preferred initial volumes and loop settings
- localStorage saves changes - Any adjustments you make are automatically saved in your browser
- Settings persist between sessions - Your customizations survive browser refreshes and restarts
- Easy reset option - One-click button to restore all settings to JSON defaults
- Export functionality - Download your current settings as a timestamped JSON file
- No complex server needed - Works with any basic web server
cd sound-tap
python3 -m http.server 8000Features: Full functionality with localStorage persistence
# Using Node.js (if installed)
npx http-server -p 8000
# Using PHP (if installed)
php -S localhost:8000# Find what's using port 8000
lsof -ti :8000
# Kill the process (replace XXXX with the process ID)
kill XXXX
# Then start the server
python3 -m http.server 8000Export Your Settings:
- Click the "π₯ Export Settings" button at the bottom of the page
- Downloads a timestamped JSON file with your current configuration
- Use this to backup your settings or share configurations
Reset All Settings:
Using the Reset Button (Easy Way):
- Click the "π Reset All Settings" button at the bottom of the page
- Confirm the action in the dialog
- Page will automatically reload with JSON defaults
Using Browser Console (Manual Way):
// Reset settings for current pack only
localStorage.removeItem('soundTapPack_sounds.json')
// Or reset all pack settings
Object.keys(localStorage).filter(key => key.startsWith('soundTapPack_')).forEach(key => localStorage.removeItem(key))Then refresh the page to use JSON defaults.
Import Settings:
- Add exported settings files to the
packs/directory - Click the refresh button (π) next to the sound pack selector to rescan for new packs
- Select the new pack from the dropdown
What Gets Exported:
{
"globalVolume": 85,
"sounds": [
{
"name": "Artesia",
"file": "sounds/Artesia.mp3",
"loop": true,
"volume": 90
}
]
}- Current global volume setting
- All individual sound volumes
- All loop states
- Filename with timestamp:
sound-tap-settings-2025-01-15T10-30-00.json
Getting "Port 8000 is already in use" error?
- You have another server running on port 8000
- Stop the old server first:
- Find the process:
lsof -ti :8000 - Kill it:
kill [process_id] - Then start the server:
python3 -m http.server 8000
- Find the process:
Server won't start or crashes?
- Make sure you're in the
sound-tapdirectory - Check that
sounds.jsonandindex.htmlare present - Try a different port:
python3 -m http.server 8001then visithttp://localhost:8001
Getting CORS errors or "Failed to load" messages?
β οΈ Most common issue: You must use a web server! Don't openindex.htmldirectly- Start a local server (basic:
python3 -m http.server 8000or enhanced:python3 server.py) - Access via http://localhost:8000 (not file://)
Sounds not loading?
- Check that file paths in
sounds.jsonare correct - Ensure audio files are in the
sounds/directory - Verify the web server is running and accessible
No sound playing?
- Check browser console for error messages
- Verify audio file format is supported by your browser
- Ensure browser isn't muted or volume is up
UI not updating?
- Hard refresh the page (Ctrl+F5 or Cmd+Shift+R)
- Check browser console for JavaScript errors
Settings not persisting between sessions?
- Check localStorage: Open browser console and run
localStorage.getItem('soundTapPack_sounds.json')- should show your saved settings for the current pack - Private/Incognito mode: localStorage is cleared when you close private browsing windows
- Browser storage issues: Try
localStorage.removeItem('soundTapSettings')then refresh to reset - Check console: Look for "β Settings saved to localStorage" messages when you change settings
Settings reset unexpectedly?
- Browser cleared storage: Check if your browser's privacy settings clear localStorage
- Different browser/device: Settings are stored per-browser, not shared between devices
- File protocol: Make sure you're using
http://localhost:8000, not openingfile://directly
Enjoy your Sound Tap experience! π΅