magicciv/public/games/age-of-dwarves/data/schemas/audio.schema.json

92 lines
3.6 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "audio",
"title": "Audio Manifest",
"description": "Theme sound pack — SFX events keyed by name, music tracks by id. Categorical keys (e.g. 'unit.melee.attack', 'building.production.complete', 'fauna.apex.roar') are part of the SFX block; the categorical fallback chain in audio_manager.gd resolves entity-scoped events to these keys.",
"type": "object",
"required": ["schema_version", "sfx", "music"],
"additionalProperties": false,
"properties": {
"schema_version": { "type": "integer", "minimum": 1 },
"sfx": {
"type": "object",
"description": "Map of SFX event key → entry. Keys may be flat ('combat_hit', 'turn_started') or dotted categorical ('unit.melee.attack').",
"additionalProperties": { "$ref": "#/$defs/sfx_entry" }
},
"music": {
"type": "object",
"required": ["tracks"],
"additionalProperties": false,
"properties": {
"tracks": {
"type": "array",
"items": { "$ref": "#/$defs/music_track" }
},
"crossfade_seconds": { "type": "number", "minimum": 0.0, "maximum": 30.0, "default": 2.0 },
"default_track_id": { "type": "string" }
}
}
},
"$defs": {
"sfx_entry": {
"type": "object",
"additionalProperties": false,
"properties": {
"stream": {
"type": "string",
"description": "Single relative stream path (legacy form). Use either `stream` or `streams`, not both. Empty `streams` arrays mark the `_silent` sentinel."
},
"streams": {
"type": "array",
"description": "Array of relative stream paths. One is picked uniformly per play to break repetition. Takes precedence over `stream` when both are present.",
"items": { "type": "string" }
},
"volume_db": {
"type": "number",
"description": "Per-event volume offset in decibels.",
"default": 0.0
},
"bus": {
"type": "string",
"description": "Mixer bus name. Master/Music/SFX are the buses created at boot by SettingsManager.",
"default": "SFX"
},
"pitch_jitter": {
"type": "number",
"description": "Per-play pitch_scale randomisation: actual scale ∈ [1j, 1+j]. 0.0 = no jitter.",
"minimum": 0.0,
"maximum": 0.5,
"default": 0.0
},
"fallback": {
"type": "string",
"description": "Sound key to try when none of this entry's streams load. Walks transitively. Bottom of the chain is the literal '_silent' sentinel — an entry with `streams: []`."
},
"description": {
"type": "string",
"description": "Author-facing notes; not used at runtime."
}
}
},
"music_track": {
"type": "object",
"required": ["id", "stream"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"stream": { "type": "string", "minLength": 1 },
"volume_db": { "type": "number", "default": -10.0 },
"bus": { "type": "string", "default": "Music" },
"loop": { "type": "boolean", "default": true },
"era_range": {
"oneOf": [
{ "type": "null" },
{ "type": "array", "items": { "type": "integer", "minimum": 1, "maximum": 10 }, "minItems": 2, "maxItems": 2 }
]
},
"mood": { "type": "string", "enum": ["ambient", "tension", "climactic", "triumph"] },
"description": { "type": "string" }
}
}
}
}