Skip to content

Text-to-Speech

Synthesize speech from text using the Hume TTS API.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// Create an authenticated client
using var client = new HumeAIClient(apiKey);

// Synthesize speech from text
var result = await client.Tts.SynthesizeJsonAsync(
    request: new PostedTts
    {
        Utterances =
        [
            new PostedUtterance
            {
                Text = "Hello! I am excited to demonstrate Hume's text-to-speech capabilities.",
                Speed = 1.0,
            },
        ],
    });

// The result contains generation metadata and audio data