{
  "$id": "https://schemas.ruter.no/adt/ota/api/v3.0/pe/audio/audio.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Audio",
  "description": "This topic provides an audio message intended for passengers onboard the vehicle that should be played on speaker(s) defined in the speaker property of the payload.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "eventTimestamp",
    "traceId",
    "expiryDateTime",
    "preferredStartDateTime",
    "ref",
    "audio"
  ],
  "properties": {
    "eventTimestamp": {
      "$id": "#/properties/eventTimestamp",
      "type": "string",
      "description": "As specified in the [ADT documentation.](https://adt.transhub.io)",
      "format": "date-time"
    },
    "traceId": {
      "$id": "#/properties/traceId",
      "type": "string",
      "description": "A unique identifier - UUID"
    },
    "expiryDateTime": {
      "$id": "#/properties/expiryDateTime",
      "type": "string",
      "description": "Do not present this information after this time. As specified in the [ADT documentation.](https://adt.transhub.io)",
      "format": "date-time"
    },
    "preferredStartDateTime": {
      "$id": "#/properties/preferredStartDateTime",
      "type": "string",
      "description": "As specified in the [ADT documentation.](https://adt.transhub.io)",
      "format": "date-time"
    },
    "ref": {
      "$id": "#/properties/ref"
    },
    "audio": {
      "$id": "#/properties/audio",
      "type": "array",
      "items": {
        "type": "object",
        "title": "audio",
        "required": [
          "speakers"
        ],
        "properties": {
          "encoding": {
            "type": "string",
            "description": "Optional. Audio message encoding",
            "enum": [
              "MP3",
              "OPUS"
            ]
          },
          "content": {
            "type": "string",
            "description": "Optional. BASE64 encoded binary data. Do not use if contentURL is defined"
          },
          "contentURL": {
            "type": "string",
            "description": "Optional. Location of content. Do not use if content is defined."
          },
          "speakers": {
            "type": "object",
            "description": "Speaker targets and volume the audio is intended for",
            "additionalProperties": {
              "type": "integer"
            }
          }
        }
      }
    }
  }
}
