Files
wedding-phone/config.example.json
grabowski 38eff5c2c8 Fix extra button to only work when OFF-hook and add greeting delay
Breaking Behavior Change:
- Extra button NOW only works when handset is OFF-hook (during call)
- Previous: worked when on-hook (idle) - REVERSED
- Reason: Button is for guests to trigger during their call/recording

New Feature - Greeting Delay:
- Add greeting_delay_seconds to config.json (0-10 seconds)
- Delays greeting playback after handset pickup
- Gives guests time to position phone comfortably
- Default: 0 (plays immediately, backward compatible)

Extra Button Logic:
- Only responds when phone_status == "off_hook"
- Ignored when phone is on-hook (idle)
- Can be pressed during greeting or recording
- Plays entire sound without interruption
- Useful for: "Press button to hear special message"

Greeting Delay Use Cases:
- Wedding: Give guests moment to settle in
- Events: Time to position phone comfortably
- Accessibility: Extra time for elderly guests
- Professional: Pause before message delivery

Configuration:
{
  "system": {
    "greeting_delay_seconds": 2,  // 2 second pause
    "extra_button_sound": "surprise.wav"
  }
}

Console Output:
- "Extra button ignored - phone is on hook" (when idle)
- "Waiting X seconds before greeting..." (delay active)
- "=== Extra button pressed ===" (during call)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 15:15:05 +07:00

33 lines
677 B
JSON

{
"gpio": {
"hook_pin": 17,
"hook_pressed_state": "LOW",
"extra_button_enabled": true,
"extra_button_pin": 27,
"extra_button_pressed_state": "LOW"
},
"audio": {
"device_index": 1,
"chunk_size": 1024,
"format": "paInt16",
"channels": 1,
"sample_rate": 44100,
"max_record_seconds": 300
},
"paths": {
"base_dir": "./rotary_phone_data",
"recordings_dir": "recordings",
"sounds_dir": "sounds"
},
"web": {
"port": 8080,
"max_upload_size_mb": 50
},
"system": {
"active_greeting": "dialtone.wav",
"extra_button_sound": "button_sound.wav",
"greeting_delay_seconds": 0,
"volume": 70
}
}