{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-text-to-speech/json-schema/google-cloud-text-to-speech-synthesize-long-audio-request-schema.json",
  "title": "SynthesizeLongAudioRequest",
  "description": "The top-level message sent by the client for the `SynthesizeLongAudio` method.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-text-to-speech-projects-api-openapi.yml#/components/schemas/SynthesizeLongAudioRequest",
  "properties": {
    "audioConfig": {
      "$ref": "#/$defs/AudioConfig",
      "description": "Required. The configuration of the synthesized audio."
    },
    "voice": {
      "$ref": "#/$defs/VoiceSelectionParams",
      "description": "Required. The desired voice of the synthesized audio."
    },
    "outputGcsUri": {
      "description": "Required. Specifies a Cloud Storage URI for the synthesis results. Must be specified in the format: `gs://bucket_name/object_name`, and the bucket must already exist.",
      "type": "string"
    },
    "input": {
      "$ref": "#/$defs/SynthesisInput",
      "description": "Required. The Synthesizer requires either plain text or SSML as input."
    }
  },
  "type": "object",
  "$defs": {
    "AudioConfig": {
      "description": "Description of audio data to be synthesized.",
      "properties": {
        "audioEncoding": {
          "type": "string",
          "description": "Required. The format of the audio byte stream.",
          "enum": [
            "AUDIO_ENCODING_UNSPECIFIED",
            "LINEAR16",
            "MP3",
            "OGG_OPUS",
            "MULAW",
            "ALAW",
            "PCM",
            "M4A"
          ]
        },
        "volumeGainDb": {
          "type": "number",
          "description": "Optional. Input only. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at approximately twice the amplitude of the normal native signal amplitude. Strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value greater than that.",
          "format": "double"
        },
        "effectsProfileId": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See [audio profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for current supported profile ids."
        },
        "pitch": {
          "format": "double",
          "description": "Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch.",
          "type": "number"
        },
        "speakingRate": {
          "description": "Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other values < 0.25 or > 2.0 will return an error.",
          "type": "number",
          "format": "double"
        },
        "sampleRateHertz": {
          "description": "Optional. The synthesis sample rate (in hertz) for this audio. When this is specified in SynthesizeSpeechRequest, if this is different from the voice's natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality), unless the specified sample rate is not supported for the encoding chosen, in which case it will fail the request and return google.rpc.Code.INVALID_ARGUMENT.",
          "format": "int32",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "CustomPronunciationParams": {
      "properties": {
        "phoneticEncoding": {
          "description": "The phonetic encoding of the phrase.",
          "enum": [
            "PHONETIC_ENCODING_UNSPECIFIED",
            "PHONETIC_ENCODING_IPA",
            "PHONETIC_ENCODING_X_SAMPA",
            "PHONETIC_ENCODING_JAPANESE_YOMIGANA",
            "PHONETIC_ENCODING_PINYIN"
          ],
          "type": "string"
        },
        "pronunciation": {
          "type": "string",
          "description": "The pronunciation of the phrase. This must be in the phonetic encoding specified above."
        },
        "phrase": {
          "description": "The phrase to which the customization is applied. The phrase can be multiple words, such as proper nouns, but shouldn't span the length of the sentence.",
          "type": "string"
        }
      },
      "description": "Pronunciation customization for a phrase.",
      "type": "object"
    },
    "CustomPronunciations": {
      "type": "object",
      "properties": {
        "pronunciations": {
          "description": "The pronunciation customizations are applied.",
          "items": {
            "$ref": "#/$defs/CustomPronunciationParams"
          },
          "type": "array"
        }
      },
      "description": "A collection of pronunciation customizations."
    },
    "CustomVoiceParams": {
      "properties": {
        "reportedUsage": {
          "enum": [
            "REPORTED_USAGE_UNSPECIFIED",
            "REALTIME",
            "OFFLINE"
          ],
          "description": "Optional. Deprecated. The usage of the synthesized audio to be reported.",
          "type": "string",
          "deprecated": true
        },
        "model": {
          "type": "string",
          "description": "Required. The name of the AutoML model that synthesizes the custom voice."
        }
      },
      "description": "Description of the custom voice to be synthesized.",
      "type": "object"
    },
    "MultiSpeakerMarkup": {
      "description": "A collection of turns for multi-speaker synthesis.",
      "type": "object",
      "properties": {
        "turns": {
          "description": "Required. Speaker turns.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Turn"
          }
        }
      }
    },
    "MultiSpeakerVoiceConfig": {
      "properties": {
        "speakerVoiceConfigs": {
          "items": {
            "$ref": "#/$defs/MultispeakerPrebuiltVoice"
          },
          "description": "Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.",
          "type": "array"
        }
      },
      "type": "object",
      "description": "Configuration for a multi-speaker text-to-speech setup. Enables the use of up to two distinct voices in a single synthesis request."
    },
    "MultispeakerPrebuiltVoice": {
      "description": "Configuration for a single speaker in a Gemini TTS multi-speaker setup. Enables dialogue between two speakers.",
      "properties": {
        "speakerId": {
          "description": "Required. The speaker ID of the voice. See https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options for available values.",
          "type": "string"
        },
        "speakerAlias": {
          "description": "Required. The speaker alias of the voice. This is the user-chosen speaker name that is used in the multispeaker text input, such as \"Speaker1\".",
          "type": "string"
        }
      },
      "type": "object"
    },
    "SynthesisInput": {
      "description": "Contains text input to be synthesized. Either `text` or `ssml` must be supplied. Supplying both or neither returns google.rpc.Code.INVALID_ARGUMENT. The input size is limited to 5000 bytes.",
      "properties": {
        "customPronunciations": {
          "$ref": "#/$defs/CustomPronunciations",
          "description": "Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag."
        },
        "ssml": {
          "description": "The SSML document to be synthesized. The SSML document must be valid and well-formed. Otherwise the RPC will fail and return google.rpc.Code.INVALID_ARGUMENT. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).",
          "type": "string"
        },
        "markup": {
          "description": "Markup for Chirp 3: HD voices specifically. This field may not be used with any other voices.",
          "type": "string"
        },
        "text": {
          "description": "The raw text to be synthesized.",
          "type": "string"
        },
        "prompt": {
          "description": "This system instruction is supported only for controllable/promptable voice models. If this system instruction is used, we pass the unedited text to Gemini-TTS. Otherwise, a default system instruction is used. AI Studio calls this system instruction, Style Instructions.",
          "type": "string"
        },
        "multiSpeakerMarkup": {
          "$ref": "#/$defs/MultiSpeakerMarkup",
          "description": "The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis."
        }
      },
      "type": "object"
    },
    "Turn": {
      "type": "object",
      "description": "A multi-speaker turn.",
      "properties": {
        "text": {
          "type": "string",
          "description": "Required. The text to speak."
        },
        "speaker": {
          "type": "string",
          "description": "Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer to documentation for available speakers."
        }
      }
    },
    "VoiceCloneParams": {
      "type": "object",
      "properties": {
        "voiceCloningKey": {
          "description": "Required. Created by GenerateVoiceCloningKey.",
          "type": "string"
        }
      },
      "description": "The configuration of Voice Clone feature."
    },
    "VoiceSelectionParams": {
      "type": "object",
      "description": "Description of which voice to use for a synthesis request.",
      "properties": {
        "voiceClone": {
          "$ref": "#/$defs/VoiceCloneParams",
          "description": "Optional. The configuration for a voice clone. If [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice clone matching the specified configuration."
        },
        "modelName": {
          "type": "string",
          "description": "Optional. The name of the model. If set, the service will choose the model matching the specified configuration."
        },
        "languageCode": {
          "description": "Required. The language (and potentially also the region) of the voice expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. \"en-US\". This should not include a script tag (e.g. use \"cmn-cn\" rather than \"cmn-Hant-cn\"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using \"nb\" (Norwegian Bokmal) instead of \"no\" (Norwegian)\".",
          "type": "string"
        },
        "ssmlGender": {
          "description": "The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement; if a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.",
          "enum": [
            "SSML_VOICE_GENDER_UNSPECIFIED",
            "MALE",
            "FEMALE",
            "NEUTRAL"
          ],
          "type": "string"
        },
        "name": {
          "description": "The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.",
          "type": "string"
        },
        "multiSpeakerVoiceConfig": {
          "$ref": "#/$defs/MultiSpeakerVoiceConfig",
          "description": "Optional. The configuration for a Gemini multi-speaker text-to-speech setup. Enables the use of two distinct voices in a single synthesis request."
        },
        "customVoice": {
          "$ref": "#/$defs/CustomVoiceParams",
          "description": "The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration."
        }
      }
    }
  }
}