Skip to main content
1

Overview

The voices endpoint provides a list of all available voices that can be used for text-to-speech conversion. Each voice includes:
  • Voice ID and name
  • Gender and locale
  • Preview audio URL
  • Additional metadata
Voice IDs are used in the speech generation endpoint to specify which voice to use for text-to-speech conversion.
2

Using the SDK

The Node.js SDK provides a simple way to list available voices:
The SDK handles authentication and error handling automatically. It’s the recommended way to interact with the Suonora API if you’re using Node.js.
3

REST API

You can list available voices using the REST API directly. Here are examples in different languages:
boolean
required
Indicates if the request was successful
array
required
Array of available voice objects

Example Response

Response Codes


Best Practices

  1. Voice Selection
    • Choose voices that match your content’s language and region
    • Consider the gender and style that best fits your use case
    • Preview voices before using them in production
  2. Caching
    • Cache the voice list to reduce API calls
    • Update the cache periodically to get new voices
    • Store voice IDs for quick reference
  3. Error Handling
    • Always check the success flag
    • Handle API errors gracefully
    • Implement retry logic for temporary failures
For production applications, consider implementing a voice selection interface that allows users to preview and choose voices based on their needs.