Essentials
Available Voices
Browse and preview the available voices for text-to-speech conversion.
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.
Best Practices
-
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
-
Caching
- Cache the voice list to reduce API calls
- Update the cache periodically to get new voices
- Store voice IDs for quick reference
-
Error Handling
- Always check the
success
flag - Handle API errors gracefully
- Implement retry logic for temporary failures
- Always check the
For production applications, consider implementing a voice selection interface that allows users to preview and choose voices based on their needs.