Overview
Web XP includes authentic Windows XP system sounds for boot, login, logout, shutdown, and error events. The sound system uses the VolumeContext for centralized volume control and supports custom sound additions.Available System Sounds
The project includes 40+ Windows XP sound files located insrc/assets/sounds/:
Primary System Sounds
- xp_startup.wav - Boot/startup sound (424KB)
- xp_logon.wav - Login sound (190KB)
- xp_logoff.wav - Logout sound (179KB)
- xp_shutdown.wav - Shutdown sound (282KB)
- error.wav - Error dialog sound (44KB)
Additional Sounds
- Windows XP Start.wav - Start menu click
- Windows XP Error.wav - Error notifications
- Windows XP Exclamation.wav - Warning dialogs
- Windows XP Ding.wav - Information alerts
- Windows XP Notify.wav - System notifications
- Windows XP Minimize.wav - Window minimize
- Windows XP Restore.wav - Window restore
- Windows XP Recycle.wav - Recycle bin
- Windows XP Menu Command.wav - Menu clicks
- Windows XP Hardware Insert.wav - Device connected
- Windows XP Hardware Remove.wav - Device disconnected
- Windows XP Hardware Fail.wav - Device error
- Windows XP Critical Stop.wav - Critical errors
- Windows XP Battery Low.wav - Low battery warning
- Windows XP Battery Critical.wav - Critical battery
- Windows XP Pop-up Blocked.wav - Popup blocker
- Windows XP Information Bar.wav - Info bar
- xp_balloon.wav - Tooltip/balloon
- chord.wav, chimes.wav, tada.wav - Classic sounds
- ringin.wav, ringout.wav - Call sounds
VolumeContext
Context Provider
The VolumeContext manages global volume and mute state with localStorage persistence (src/context/VolumeContext.jsx:1-41):
Setup in Application
The VolumeProvider wraps the entire app (src/App.jsx:180-186):
Audio Playback Implementation
Basic Sound Playback
The standard playback function (src/App.jsx:29-43):
System Event Sounds
Sounds are imported and played on specific events (src/App.jsx:10-13):
Desktop Sounds
For sounds within the desktop environment (src/WinXP/index.jsx:28-44):
Volume Control UI
The volume slider appears when clicking the speaker icon in the taskbar (src/WinXP/Footer/index.jsx:11-12,43-46):
VolumeSlider Component
The slider component (src/components/VolumeSlider/index.jsx:69-102):
Adding Custom Sounds
1. Add Sound File
Place your.wav file in src/assets/sounds/:
2. Import the Sound
Import it in your component:3. Play with Volume Control
Use the playSound pattern:4. Add to System Events
To play on specific events, add to the appropriate handler:Best Practices
- Always Use applyVolume: Ensures sounds respect user volume settings
- Handle Errors Gracefully: Use try-catch and empty catch blocks for play() promises
- Use .wav Format: For compatibility with Windows XP aesthetic
- Keep Files Small: Compress audio files to reduce bundle size
- Avoid Autoplay: Only play sounds in response to user actions
- Test Mute State: Ensure sounds respect the mute setting
Sound File Sizes
Be mindful of audio file sizes. The current sounds range from:- Small: 1-5KB (menu clicks)
- Medium: 20-50KB (notifications)
- Large: 100-400KB (startup/shutdown)
Related Files
src/context/VolumeContext.jsx- Volume managementsrc/components/VolumeSlider/index.jsx- Volume UI controlsrc/App.jsx- Boot/login/logout soundssrc/WinXP/index.jsx- Desktop sound playbacksrc/WinXP/Footer/index.jsx- Volume icon and slidersrc/assets/sounds/- All sound files
