Skip to content

Text to Speech

Synthesize natural-sounding speech from text using an Inworld voice.

This example assumes using Inworld; is in scope and apiKey contains your Inworld API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
// Create an Inworld client using your API key.
using var client = new InworldClient(apiKey);

// Synthesize a short greeting using the Inworld TTS 1.5 Max model.
var response = await client.TextToSpeech.SynthesizeSpeechAsync(
    text: "Hello, welcome to Inworld.",
    voiceId: "Dennis",
    modelId: "inworld-tts-1.5-max");

// The response contains Base64-encoded audio bytes ready to decode into a playable file.