Skip to main content

Overview

Speech generation in Suonora involves:
  • Text Input: The text you want to convert to speech
  • Voice Selection: Choosing from available voices
  • Audio Output: Receiving the generated audio file

JavaScript SDK

The JavaScript SDK provides the easiest way to integrate Suonora into your Node.js applications.

Installation

Basic Usage

Advanced Usage with Options

Error Handling

Python

Python provides a straightforward way to interact with the Suonora API using the requests library.

Installation

Basic Usage

Advanced Usage with Options

Error Handling

Java

Java applications can use the HttpClient to interact with the Suonora API.

Basic Usage

Advanced Usage with Options

Error Handling

cURL

cURL is perfect for testing the API or integrating with shell scripts.

Basic Usage

Advanced Usage with Options

Base64 Response Format

Error Handling

Best Practices

Follow these best practices for optimal speech generation results.

Text Preparation

  • Punctuation: Use proper punctuation to help the AI understand sentence structure
  • Length: Keep individual requests under 4,096 characters for best results
  • Language: Ensure text is in a language supported by your chosen voice
  • Formatting: Remove unnecessary formatting and special characters

Voice Selection

  • Consistency: Use the same voice throughout your application for brand consistency
  • Testing: Test different voices with your specific content
  • Quality: Use legacy-v2.5 for higher quality audio when needed

Performance Optimization

  • Caching: Cache generated audio for repeated text
  • Batch Processing: Process multiple requests efficiently
  • Error Handling: Implement proper error handling and retry logic
  • Rate Limits: Respect API rate limits and implement backoff strategies

File Management

  • Formats: Choose appropriate audio formats (MP3 for compatibility, Opus for efficiency)
  • Storage: Implement proper file storage and cleanup
  • Naming: Use descriptive filenames for generated audio files

Common Use Cases

E-learning Applications

Accessibility Features

Content Creation

Next Steps

Now that you understand the essentials of creating speech with the Suonora API, you can: