Global Controls

OverviewCopied!

When generating speech through Replica's API, you can apply global controls to adjust the overall characteristics of the generated audio. These controls affect the entire speech output uniformly, unlike SSML tags which can be applied to specific segments.

Available Global ParametersCopied!

Parameter

Description

Valid Range

Example

global_pace

Controls the overall speaking rate

50% to 150% (0.5 - 1.5)

0.8

global_pitch

Adjusts the pitch in semitones

-18st to +18st

-2

global_volume

Changes the overall volume in decibels

-6dB to +6db

3

Using Global ControlsCopied!

When making a Text-to-Speech (TTS) or Speech-to-Speech (STS) request, include these parameters in your request body:

import requests
url = "https://api.replicastudios.com/v2/speech/tts"

payload = {
    "speaker_id": "9b1f5c24-a18b-4b9e-a785-b3a3b3b8751a",
    "text": "Welcome to Replica Studios.",
    "global_pace": 0.8, # Slightly slower
    "global_pitch": -2, # Lower pitch
    "global_volume": 3, # Louder
    "model_chain": "latest",
    "language_code": "en"
}

headers = {
    "Content-Type": "application/json",
    "X-Api-Key": "..." # Replace with your API key
}

response = requests.post(url, json=payload, headers=headers)

Guidelines and Best PracticesCopied!

Pace Adjustment

  • Values below 1.0 slow down the speech

  • Values above 1.0 speed up the speech

  • Recommended range: 0.5 to 1.5 for most natural results

Pitch Adjustment

  • Measured in semitones (st)

  • Negative values lower the pitch

  • Positive values raise the pitch

  • Keep adjustments within ±18st for most natural results

Volume Adjustment

  • Measured in decibels (dB)

  • Negative values decrease volume

  • Positive values increase volume

  • Consider the target platform's playback capabilities - without additional processing, audio may clip.

Global Controls vs SSMLCopied!

Use Global Controls when you want to:

  • Apply consistent changes across the entire speech

  • Make quick adjustments without modifying the text

  • Maintain the same settings across multiple generations

Use SSML when you want to:

  • Apply changes to specific words or phrases

  • Create dynamic variations within the same text

  • Have fine-grained control over specific segments

Global controls can be used in combination with SSML tags. The global controls will be applied independently of SSML processing.

For more detailed control over specific parts of the speech, consider using SSML tags in combination with these global controls.