{
  "swagger": "2.0",
  "info": {
    "title": "Speech Synthesis-TTS",
    "version": "2019-02-15",
    "license": {
      "name": "OCF Data Model License",
      "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md",
      "x-copyright": "copyright 2016-2017, 2019 Open Connectivity Foundation, Inc. All rights reserved."
    },
    "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md"
  },
  "schemes": [
    "http"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/SpeechTTSResURI": {
      "get": {
        "description": "This Resource may be created on the OCF Server that is capable of rendering speech by an OCF Client and allows the client to provide an SSML document with text to render\n or may be created on the OIC Server by some resident application.\nThe audio rendered is at this stage local to the Server (i.e. not streamed).\nThe utterance is an SSML document.\nThe supportedLanguages is an array of the RFC5646 defined language tags that are supported.\nThe supportedVoices is an SSML document fragment indicating the voices that are supported.\nUtterance in the example shall be a properly escaped (JSON rules) SSML document. An example:\n  \"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\r\n  <speak version=\"1.1\" xmlns=\"http://www.w3.org/2001/10/synthesis\"\n\r\n  \txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\r\n  \txsi:schemaLocation=\"http://www.w3.org/2001/10/synthesis\n\r\n  \thttp://www.w3.org/TR/speech-synthesis11/synthesis.xsd\"\n\r\n  \txml:lang=\"en-US\">\n\r\n  \n\r\n  \tThe title of the movie is:\n\r\n  \t\"Monty Pythons The Meaning of Life\"\n\r\n  \twhich is directed by Terry Jones.\n\r\n  </speak\"\n",
        "parameters": [
          {
            "$ref": "#/parameters/interface"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "x-example": {
              "rt": [
                "oic.r.speech.tts"
              ],
              "if": [
                "oic.if.a",
                "oic.if.baseline"
              ],
              "utterance": "Strange women lying in ponds distributing swords is no basis for a system of government.",
              "supportedLanguages": [
                "en-US",
                "en-GB",
                "fr-CA"
              ],
              "supportedVoices": "<voice gender=\"female\" variant=\"2\"></voice>\n\r<voice name=\"Mike\"></voice>"
            },
            "schema": {
              "$ref": "#/definitions/Speech"
            }
          }
        }
      },
      "post": {
        "description": "Changes the utterance being rendered.\nExample shows a change in language selected.\n",
        "parameters": [
          {
            "$ref": "#/parameters/interface"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Speech"
            },
            "x-example": {
              "utterance": "Alright, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, the fresh-water system, and public health, what have the Romans ever done for us?"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "x-example": {
              "utterance": "Alright, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, the fresh-water system, and public health, what have the Romans ever done for us?"
            },
            "schema": {
              "$ref": "#/definitions/Speech"
            }
          }
        }
      }
    }
  },
  "parameters": {
    "interface": {
      "in": "query",
      "name": "if",
      "type": "string",
      "enum": [
        "oic.if.a",
        "oic.if.baseline"
      ]
    }
  },
  "definitions": {
    "Speech": {
      "properties": {
        "rt": {
          "description": "The Resource Type.",
          "items": {
            "enum": [
              "oic.r.speech.tts"
            ],
            "maxLength": 64,
            "type": "string"
          },
          "minItems": 1,
          "uniqueItems": true,
          "readOnly": true,
          "type": "array"
        },
        "supportedLanguages": {
          "description": "The array of supported language tags.",
          "items": {
            "type": "string"
          },
          "readOnly": true,
          "type": "array"
        },
        "supportedVoices": {
          "description": "The SSML document fragment indicating supported voices.",
          "readOnly": true,
          "maxLength": 1024,
          "type": "string"
        },
        "utterance": {
          "description": "The SSML document including the speech body.",
          "maxLength": 1024,
          "type": "string"
        },
        "n": {
          "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n"
        },
        "id": {
          "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id"
        },
        "if": {
          "description": "The OCF Interface set supported by this Resource.",
          "items": {
            "enum": [
              "oic.if.a",
              "oic.if.baseline"
            ],
            "type": "string"
          },
          "minItems": 2,
          "uniqueItems": true,
          "readOnly": true,
          "type": "array"
        }
      },
      "type": "object",
      "required": [
        "utterance"
      ]
    }
  }
}