Audio Generation for Convergence Protocol

This directory contains the audio generation script and assets for THE MOTEL experience.

Setup

  1. Get an ElevenLabs API key from https://elevenlabs.io
  2. Set environment variable:
    export ELEVENLABS_API_KEY="your-api-key-here"

Generate Audio

Run the generation script:

cd ~/Public/convergence-protocol
python3 generate_audio.py

This will create all sound files in assets/audio/:

  • doors/ - Door open/close/locked/hover sounds
  • ambient/ - Hallway loop, void drone, neon buzz
  • ui/ - Check-in, complete, transition sounds
  • narration/ - 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:

  1. Listen for ambient hallway sound after loading
  2. Hover over doors - different sounds for each state
  3. Click a door - hear open sound
  4. Navigate back to motel - ambient resumes

Troubleshooting

  • No sound: Check browser console for AudioContext errors. User interaction required.
  • Missing files: Run generate_audio.py again. Skips existing files.
  • CORS errors: Serve via local server, not file:// protocol.