Partner Voices in Azure Speech (preview)

Note

Partner Voices are in public preview and are subject to the Supplemental Terms of Use for Microsoft Azure Previews. Partner Voices are provided by third parties. During public preview, don't use Partner Voices in production. Microsoft might deprecate Partner Voices without notice.

Partner Voices is a catalog of professionally produced voices from leading voice agencies, available in the Microsoft Foundry voice gallery and the Azure Speech text to speech API. Every Partner Voice is built on the same model as Azure Speech HD voices.

You use Partner Voices with the same Speech API, SDKs, and SSML as other Azure Speech HD voices. Partner Voices have the same pricing as other Azure Speech HD voices.

Prerequisites

  • An Azure subscription.
  • A Microsoft Foundry resource for Speech on a paid tier. Partner Voices aren't available on the free (F0) tier.
  • Your resource endpoint, which uses your resource's custom domain, for example https://<your-resource-name>.cognitiveservices.azure.com.
  • To sign in with Microsoft Entra ID (recommended), the Cognitive Services Speech User role assigned to your account or app on the resource. For details, see Microsoft Entra authentication.

Availability and regions

Partner Voices is available in the same region as HD voices. Refer to Supported regions for Azure Speech - Foundry Tools | Microsoft Learn.

Pricing

Partner Voices are billed at the same rate as Azure Speech HD voices and aren't available on the free (F0) tier. For pricing details, see Azure Speech pricing.

Use a Partner Voice

Voice name format

Each Partner Voice has a display name, such as TTS-222, and a voice ID. In SSML, use the full voice name, which combines the voice ID and the model name:

<voice name="<partner-voice-id>:DragonHDV2.5Neural">

To get the full voice name for each Partner Voice, call the voice list API. Partner Voices return "category": "partner", and the full voice name is in fineTunedBaseModels.fullName. For example: [confirm voice list API link and response format before publishing]

{
  "voiceId": "partner_21228fe908944569817df5",
  "name": "TTS-222",
  "category": "partner",
  "locale": "zh-CN",
  "gender": "female",
  "scenarios": ["personal_assistant", "podcast"],
  "fineTunedBaseModels": [
    {
      "modelId": "DragonHDV2.5Neural",
      "fullName": "partner_21228fe908944569817df5:DragonHDV2.5Neural",
      "releaseStatus": "Public Preview"
    }
  ],
  "publicOwnerId": "dataocean"
}

Here's a complete SSML example that uses this voice:

<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="zh-CN">
  <voice name="partner_21228fe908944569817df5:DragonHDV2.5Neural">
    你好,这是来自 Azure 语音合作伙伴声音的示例。
  </voice>
</speak>

Note

When Microsoft upgrades Partner Voices to a newer HD model, the model part of the full voice name can change. Always get the latest full voice name from the voice list API.

For the SDK examples that read SSML from a file, save the complete SSML example as partner-voice.ssml with UTF-8 encoding. Replace the voice name with the latest full voice name from the voice list API. The file must be available in your application's working directory, or in the app bundle for Swift.

Try it in the Foundry portal

  1. Go to the Text to speech feature page and select Open in playground.
  2. In the voice dropdown, search for a Partner Voice by its name, such as TTS-222.
  3. Enter sample text, and then select Play.

REST

Use Microsoft Entra ID with your resource's custom domain endpoint. Set the SPEECH_ENDPOINT environment variable to your resource endpoint (for example, https://<your-resource-name>.cognitiveservices.azure.com), sign in with the Azure CLI (az login), and then run:

TOKEN=$(az account get-access-token --resource https://cognitiveservices.azure.com --query accessToken --output tsv)

curl -X POST \
  "${SPEECH_ENDPOINT}/tts/cognitiveservices/v1" \
  --header "Authorization: Bearer ${TOKEN}" \
  --header "Content-Type: application/ssml+xml" \
  --header "X-Microsoft-OutputFormat: audio-24khz-160kbitrate-mono-mp3" \
  --data '<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">
    <voice name="<partner-voice-id>:DragonHDV2.5Neural">
      Hello, this is a sample from Partner Voices in Azure Speech.
    </voice>
  </speak>' \
  --output output.mp3

If you use an existing Speech resource that doesn't have a custom domain, use the regional endpoint with your resource key instead. Set the SPEECH_KEY and SPEECH_REGION environment variables, and then run:

curl -X POST \
  "https://${SPEECH_REGION}.tts.speech.microsoft.com/cognitiveservices/v1" \
  --header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" \
  --header "Content-Type: application/ssml+xml" \
  --header "X-Microsoft-OutputFormat: audio-24khz-160kbitrate-mono-mp3" \
  --data '<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">
    <voice name="<partner-voice-id>:DragonHDV2.5Neural">
      Hello, this is a sample from Partner Voices in Azure Speech.
    </voice>
  </speak>' \
  --output output.mp3

Python

Install the azure-cognitiveservices-speech and azure-identity packages, set the SPEECH_ENDPOINT environment variable, and then run:

import os
import azure.cognitiveservices.speech as speechsdk
from azure.identity import DefaultAzureCredential

speech_config = speechsdk.SpeechConfig(
    token_credential=DefaultAzureCredential(),
    endpoint=os.environ["SPEECH_ENDPOINT"],
)
speech_config.set_speech_synthesis_output_format(
    speechsdk.SpeechSynthesisOutputFormat.Audio24Khz160KBitRateMonoMp3
)
audio_config = speechsdk.audio.AudioOutputConfig(filename="output.mp3")
synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)

ssml = """
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">
  <voice name="<partner-voice-id>:DragonHDV2.5Neural">
    Hello, this is a sample from Partner Voices in Azure Speech.
  </voice>
</speak>
"""

result = synthesizer.speak_ssml_async(ssml).get()
if result.reason != speechsdk.ResultReason.SynthesizingAudioCompleted:
    raise RuntimeError(f"Speech synthesis failed: {result.reason}")

If you use an existing Speech resource that doesn't have a custom domain, create the configuration with your resource key and region instead:

speech_config = speechsdk.SpeechConfig(
    subscription=os.environ["SPEECH_KEY"],
    region=os.environ["SPEECH_REGION"],
)

C#

Follow the C# text to speech quickstart to install the Speech SDK and configure your resource and audio output. Replace the text input and SpeakTextAsync call with the following code. Keep the quickstart's OutputSpeechSynthesisResult helper to report synthesis errors.

var ssml = System.IO.File.ReadAllText("partner-voice.ssml");
var speechSynthesisResult = await speechSynthesizer.SpeakSsmlAsync(ssml);
OutputSpeechSynthesisResult(speechSynthesisResult, ssml);

JavaScript

Follow the JavaScript text to speech quickstart to install the Speech SDK and configure your resource and audio output. Add this import at the top of your module:

import { readFileSync } from "node:fs";

After you create synthesizer, replace the console input and text synthesis block with the following code:

const ssml = readFileSync("partner-voice.ssml", "utf8");
synthesizer.speakSsmlAsync(
    ssml,
    (result) => {
        if (result.reason === ResultReason.SynthesizingAudioCompleted) {
            console.log("Speech synthesis completed.");
        } else {
            console.error(`Speech synthesis failed: ${result.errorDetails}`);
            process.exitCode = 1;
        }
        synthesizer.close();
    },
    (error) => {
        console.error(`Speech synthesis failed: ${error}`);
        synthesizer.close();
        process.exitCode = 1;
    }
);

Java

Follow the Java text to speech quickstart to install the Speech SDK and configure your resource and audio output. Add java.io.IOException to the exceptions declared by main. Replace the text input and SpeakTextAsync call with the following code, and keep the quickstart's result and cancellation handling.

String text = new String(
    java.nio.file.Files.readAllBytes(java.nio.file.Paths.get("partner-voice.ssml")),
    java.nio.charset.StandardCharsets.UTF_8
);
SpeechSynthesisResult speechSynthesisResult =
    speechSynthesizer.SpeakSsmlAsync(text).get();

C++

Follow the C++ text to speech quickstart to install the Speech SDK and configure your resource and audio output. Add the <fstream>, <iterator>, and <stdexcept> headers. Replace the text input and SpeakTextAsync call with the following code, and keep the quickstart's result and cancellation handling.

std::ifstream input("partner-voice.ssml");
if (!input)
{
    throw std::runtime_error("Unable to open partner-voice.ssml");
}
std::string text(
    (std::istreambuf_iterator<char>(input)),
    std::istreambuf_iterator<char>()
);
auto result = speechSynthesizer->SpeakSsmlAsync(text).get();

Go

Follow the Go text to speech quickstart to install the Speech SDK and configure your resource and audio output. Replace the console input, text synthesis, and final keypress prompt with the following code. Remove the unused bufio and strings imports. Keep the quickstart's outputSpeechSynthesisResult helper to report synthesis errors.

ssml, err := os.ReadFile("partner-voice.ssml")
if err != nil {
    fmt.Fprintln(os.Stderr, "Unable to read partner-voice.ssml:", err)
    return
}
outcome := <-speechSynthesizer.SpeakSsmlAsync(string(ssml))
defer outcome.Close()
if outcome.Error != nil {
    fmt.Fprintln(os.Stderr, "Speech synthesis failed:", outcome.Error)
    return
}
result := outcome.Result
defer result.Close()
outputSpeechSynthesisResult(result, string(ssml))

Swift

Follow the Swift text to speech quickstart to install the Speech SDK and configure your resource and audio output. Add partner-voice.ssml to your app target's Copy Bundle Resources build phase. In the synthesize method, replace the speakText call and its result handling with the following code:

guard let ssmlURL = Bundle.main.url(forResource: "partner-voice", withExtension: "ssml") else {
    print("Add partner-voice.ssml to the app bundle.")
    return
}
do {
    let ssml = try String(contentsOf: ssmlURL, encoding: .utf8)
    let result = try synthesizer.speakSsml(ssml)
    if result.reason == SPXResultReason.canceled {
        let details = try SPXSpeechSynthesisCancellationDetails(fromCanceledSynthesisResult: result)
        print("Speech synthesis canceled: \(details.errorDetails ?? "No error details returned.")")
    }
} catch {
    print("Speech synthesis failed: \(error)")
}

TypeScript

To install the Speech SDK and configure your resource and audio output, see the TypeScript text to speech quickstart. Add this import at the top of your module:

import { readFileSync } from "node:fs";

After you create synthesizer, replace the console input and text synthesis block with the following code:

const ssml = readFileSync("partner-voice.ssml", "utf8");
synthesizer.speakSsmlAsync(
    ssml,
    (result) => {
        if (result.reason === ResultReason.SynthesizingAudioCompleted) {
            console.log("Speech synthesis completed.");
        } else {
            console.error(`Speech synthesis failed: ${result.errorDetails}`);
            process.exitCode = 1;
        }
        synthesizer.close();
    },
    (error) => {
        console.error(`Speech synthesis failed: ${error}`);
        synthesizer.close();
        process.exitCode = 1;
    }
);

Available partner voices

The following voices are available from partner DataoceanAI. All voices use the DragonHDV2.5Neural model.

Voice name Primary locale Gender Partner
TTS-353-F1 en-CA Female DataoceanAI
TTS-354-F1 en-CA Female DataoceanAI
TTS-127-M318 en-US Male DataoceanAI
TTS-286 en-US Male DataoceanAI
TTS-048 ja-JP Female DataoceanAI
TTS-038 ko-KR Male DataoceanAI
TTS-044 pt-PT Male DataoceanAI
TTS-125 zh-CN Male DataoceanAI
TTS-128 zh-CN Male DataoceanAI
TTS-130 zh-CN Female DataoceanAI
TTS-194 zh-CN Male DataoceanAI
TTS-220-1 zh-CN Female DataoceanAI
TTS-220-F543 zh-CN Female DataoceanAI
TTS-220-M325-81 zh-CN Male DataoceanAI
TTS-222 zh-CN Female DataoceanAI
TTS-243 zh-CN Male DataoceanAI
TTS-264 zh-CN Female DataoceanAI
TTS-272 zh-CN Male DataoceanAI
TTS-288 zh-CN Male DataoceanAI
TTS-289 zh-CN Female DataoceanAI
TTS-298-M24 zh-CN Male DataoceanAI
TTS-302 zh-CN Female DataoceanAI
TTS-303 zh-CN Male DataoceanAI
TTS-304 zh-CN Male DataoceanAI
TTS-305 zh-CN Male DataoceanAI
TTS-307 zh-CN Female DataoceanAI
TTS-309 zh-CN Female DataoceanAI
TTS-311 zh-CN Male DataoceanAI
TTS-312 zh-CN Male DataoceanAI
TTS-320 zh-CN Female DataoceanAI
TTS-325 zh-CN Female DataoceanAI
TTS-326 zh-CN Female DataoceanAI
TTS-328 zh-CN Male DataoceanAI
TTS-329 zh-CN Male DataoceanAI
TTS-330 zh-CN Male DataoceanAI
TTS-332 zh-CN Female DataoceanAI
TTS-333 zh-CN Female DataoceanAI
TTS-335 zh-CN Male DataoceanAI
TTS-336 zh-CN Male DataoceanAI
TTS-338 zh-CN Male DataoceanAI
TTS-340 zh-CN Female DataoceanAI
TTS-370 zh-CN Male DataoceanAI
TTS-373-F231 zh-CN Female DataoceanAI
TTS-373-F261 zh-CN Female DataoceanAI

Note

Some zh-CN voices speak with a regional dialect or accent: TTS-222 (Sichuan dialect), TTS-320 (Northeastern dialect), TTS-220-1, TTS-220-F543, and TTS-220-M325-81 (Beijing accent), and TTS-243 (Tianjin accent).