{
    "$schema": "http://json-schema.org/draft-07/schema",
    "$id": "https://burrito.bible/schema/scripture/audio_translation.schema.json",
    "title": "Flavor Details: Audio Translation",
    "type": "object",
    "description": "Schema of flavor field of scripture/audioTranslation flavor",
    "definitions": {
        "format": {
            "type": "object",
            "properties": {
                "compression": {
                    "type": "string",
                    "enum": ["mp3", "wav"]
                },
                "trackConfiguration": {
                    "type": "string",
                    "enum": ["1/0 (Mono)", "Dual mono", "2/0 (Stereo)", "5.1 Surround"]
                },
                "bitRate": { "type": "integer" },
                "bitDepth": { "type": "integer" },
                "samplingRate": { "type": "integer" },
                "timingDir": { "$ref": "../common.schema.json#/definitions/path" }
            },
            "required": ["compression"],
            "additionalProperties": false
        }
    },
    "properties": {
        "name": {
            "const": "audioTranslation"
        },
        "performance": {
            "type": "array",
            "items": {
                "type": "string",
                "enum": ["singleVoice", "multipleVoice", "reading", "drama", "withMusic", "withEffects", "withHeadings"]
            },
            "uniqueItems": true,
            "allOf": [
                {
                    "if": {
                        "contains": {
                            "const": "singleVoice"
                        }
                    },
                    "then": {
                        "not": {
                            "contains": {
                                "const": "multipleVoice"
                            }
                        }
                    },
                    "else": {
                        "contains": {
                            "const": "multipleVoice"
                        }
                    }
                },
                {
                    "if": {
                        "contains": {
                            "const": "reading"
                        }
                    },
                    "then": {
                        "not": {
                            "contains": {
                                "const": "drama"
                            }
                        }
                    },
                    "else": {
                        "contains": {
                            "const": "drama"
                        }
                    }
                }
            ]
        },
        "formats": {
            "type": "object",
            "additionalProperties": {
                "$ref": "#/definitions/format"
            },
            "propertyNames": { "type": "string" }
        },
        "conventions": {
            "type": "object",
            "additionalProperties": {
                "type": "string",
                "pattern": "^\\d+[.]\\d+([.].+)?$"
            },
            "propertyNames": {
                "type": "string",
                "pattern": "^(x-)?[a-z][A-za-z0-9]*$",
                "oneOf": [
                    { "$ref": "../common.schema.json#/definitions/xToken" },
                    { "enum": ["contentResourcesByChapter", "bookDirs"] }
                ]
            }
        }
    },
    "required": ["performance", "formats"],
    "additionalProperties": false
}
