Skip to main content

List Available Voices

import com.kugelaudio.sdk.Voice;
import com.kugelaudio.sdk.VoiceListResponse;

// List all available voices (returns VoiceListResponse)
VoiceListResponse result = client.voices().list();

for (Voice voice : result.getVoices()) {
    System.out.println(voice.getId() + ": " + voice.getName());
    System.out.println("  Sex: " + voice.getSex());
    System.out.println("  Language: " + voice.getLanguage());
}
System.out.printf("Showing %d of %d%n", result.getVoices().size(), result.getTotal());

// Filter by language and paginate
VoiceListResponse page = client.voices().list("de", true, 10, 0);

Get a Specific Voice

import com.kugelaudio.sdk.VoiceDetail;

VoiceDetail voice = client.voices().get(1071);
System.out.println("Voice: " + voice.getName());
for (var ref : voice.getReferences()) {
    System.out.println("  Reference: " + ref.getId());
}

Create a Voice

import java.nio.file.Path;
import java.util.List;

VoiceDetail voice = client.voices().create(
    "My Custom Voice",
    "female",
    "en",
    List.of(Path.of("reference1.wav"), Path.of("reference2.wav"))
);
System.out.println("Created voice: " + voice.getId());

Update a Voice

import java.util.Map;

VoiceDetail voice = client.voices().update(1071, Map.of(
    "name", "Updated Name"
));

Delete a Voice

client.voices().delete(1071);

Manage Reference Audio

import com.kugelaudio.sdk.VoiceReference;

// List references
List<VoiceReference> refs = client.voices().listReferences(1071);
for (VoiceReference ref : refs) {
    System.out.println(ref.getId() + ": " + ref.getReferenceText());
}

// Add a new reference
VoiceReference ref = client.voices().addReference(
    123,
    Path.of("new_reference.wav"),
    "Optional transcript of the audio."
);

// Delete a reference
client.voices().deleteReference(1071, 456);

Publish a Voice

Request that your voice be made publicly available. An admin will verify it before it becomes visible to others.
VoiceDetail voice = client.voices().publish(1071);
System.out.println("Is public: " + voice.isPublic());

Generate Voice Sample

VoiceDetail voice = client.voices().generateSample(1071);
System.out.println("Sample URL: " + voice.getSampleUrl());

Next: Dictionaries — per-project pronunciation and replacement lists.