Audio Generation for Convergence Protocol
This directory contains the audio generation script and assets for THE MOTEL experience.
Setup
- Get an ElevenLabs API key from https://elevenlabs.io
- Set environment variable:
export ELEVENLABS_API_KEY="your-api-key-here"
Generate Audio
Run the generation script:
cd ~/Public/convergence-protocol
python3 generate_audio.pyThis will create all sound files in assets/audio/:
doors/- Door open/close/locked/hover soundsambient/- Hallway loop, void drone, neon buzzui/- Check-in, complete, transition soundsnarration/- Welcome, check-in, complete voice lines
Costs
- Sound Effects: ~$0.008 per second
- Text-to-Speech: ~$0.030 per 1000 characters
- Total estimated cost: ~$2-3 for full audio pack
AudioManager Integration
The AudioManager class is already integrated into index.html:
- Initializes on page load
- Plays ambient hallway loop
- Door hover sounds (different for available/preview/locked)
- Door open/close sounds
- Narration on check-in
- Spatial audio mixing via Web Audio API
Manual Testing
Open index.html in a browser and:
- Listen for ambient hallway sound after loading
- Hover over doors - different sounds for each state
- Click a door - hear open sound
- Navigate back to motel - ambient resumes
Troubleshooting
- No sound: Check browser console for AudioContext errors. User interaction required.
- Missing files: Run
generate_audio.pyagain. Skips existing files. - CORS errors: Serve via local server, not file:// protocol.