# Sound Effects Configuration

# Audio library path
audio:
  sounds_directory: "/home/seb/saltybot-data/sounds"  # Audio files location
  supported_formats: [".wav", ".ogg"]                 # Supported file formats
  default_format: "wav"                               # Default synthesis format

# Volume control
volume:
  default_volume: 0.7                                 # Default playback volume (0.0-1.0)
  quiet_mode_volume: 0.4                              # Quiet mode volume reduction
  night_mode_volume: 0.3                              # Night mode volume reduction
  max_volume: 1.0                                     # Absolute maximum
  min_volume: 0.0                                     # Absolute minimum
  fade_in_time: 0.1                                   # Fade in duration (seconds)
  fade_out_time: 0.2                                  # Fade out duration (seconds)

# Event definitions
events:
  boot_complete:
    description: "Robot startup chime"
    filename: "boot_complete.wav"
    duration: 1.2
    priority: 100
    repeat: false
    
  person_detected:
    description: "Subtle detection sound"
    filename: "person_detected.wav"
    duration: 0.5
    priority: 20
    repeat: false
    
  wake_word:
    description: "Wake word activation beep"
    filename: "wake_word.wav"
    duration: 0.3
    priority: 80
    repeat: false
    
  low_battery:
    description: "Low battery warning"
    filename: "low_battery.wav"
    duration: 1.0
    priority: 90
    repeat: false
    
  obstacle_close:
    description: "Proximity warning beep"
    filename: "obstacle_close.wav"
    duration: 0.4
    priority: 70
    repeat: false
    
  trick_complete:
    description: "Trick execution jingle"
    filename: "trick_complete.wav"
    duration: 1.5
    priority: 50
    repeat: false
    
  error:
    description: "Error descending tone"
    filename: "error.wav"
    duration: 0.8
    priority: 85
    repeat: false
    
  charging_start:
    description: "Charging initiated power-up"
    filename: "charging_start.wav"
    duration: 1.0
    priority: 60
    repeat: false
    
  geofence_warning:
    description: "Geofence boundary alert"
    filename: "geofence_warning.wav"
    duration: 0.9
    priority: 75
    repeat: false

# Programmatic sound generation
synthesis:
  enabled: true                    # Enable fallback synthesis if files missing
  sample_rate: 16000               # Sample rate (Hz)
  bit_depth: 16                    # Bit depth (16 or 24)
  
  # Default tones for each event
  defaults:
    boot_complete:
      type: "chime"                # Ascending notes
      duration: 1.2
      frequencies: [523.25, 659.25, 783.99]  # C5, E5, G5
      
    person_detected:
      type: "sine"
      duration: 0.5
      frequency: 800               # Hz
      
    wake_word:
      type: "beep"
      duration: 0.3
      frequency: 1000
      
    low_battery:
      type: "warning"              # Double beep
      duration: 1.0
      frequency: 880
      
    obstacle_close:
      type: "proximity"            # Rapid beeps
      duration: 0.4
      frequency: 1200
      pulse_rate: 5                # Pulses per second
      
    trick_complete:
      type: "jingle"               # Ascending arpeggio
      duration: 1.5
      frequencies: [523.25, 659.25, 783.99, 987.77]  # C5, E5, G5, B5
      
    error:
      type: "descending"           # Descending tone
      duration: 0.8
      frequencies: [800, 600, 400]
      
    charging_start:
      type: "power_up"             # Rising tone
      duration: 1.0
      start_freq: 400
      end_freq: 1200
      
    geofence_warning:
      type: "alert"                # Repeating tone
      duration: 0.9
      frequency: 950

# Priority queue settings
queue:
  max_size: 20                     # Maximum queued events
  overlap_allowed: true            # Allow sounds to overlap
  ducking: false                   # Reduce volume of existing sounds for new ones
  duck_amount: 0.5                 # How much to reduce (0.0-1.0)

# Topic subscriptions
subscriptions:
  boot_complete: "/saltybot/system/boot_complete"
  person_detected: "/saltybot/perception/person_detected"
  wake_word: "/saltybot/voice/wake_word"
  low_battery: "/saltybot/battery/low_warning"
  obstacle_close: "/saltybot/obstacle/close"
  trick_complete: "/saltybot/tricks/complete"
  error: "/saltybot/system/error"
  charging_start: "/saltybot/charging/started"
  geofence_warning: "/saltybot/geofence/warning"

# Publishing
publications:
  sound_playing: "/saltybot/sound_playing"

# Mode settings
modes:
  quiet_mode_enabled: false       # Global quiet mode
  night_mode_enabled: false       # Night mode affects volume
  mute_all: false                 # Mute all sounds
