The simplest way to generate audio is using the convenience methods that handle the entire async workflow for you:
Copy
import audixa# Set your API key (or use AUDIXA_API_KEY env variable)audixa.set_api_key("YOUR_API_KEY")# Generate TTS and get audio URLaudio_url = audixa.tts_and_wait( "Hello! Welcome to Audixa, the best text-to-speech API.", voice_id="am_ethan",)print(f"Audio URL: {audio_url}")# Or save directly to fileaudixa.tts_to_file( "Hello! Welcome to Audixa.", "output.wav", voice_id="am_ethan",)
import audixaaudixa.set_api_key("YOUR_API_KEY")# Base model with speed adjustmentaudio_url = audixa.tts_and_wait( "Welcome to Audixa AI, your text-to-speech solution.", voice_id="am_ethan", model="base", speed=1.1, # Slightly faster (0.5 to 2.0))# Advanced model with expressiveness controlsaudio_url = audixa.tts_and_wait( "This is exciting news! We have launched.", voice_id="am_ethan", model="advanced", cfg_weight=3.5, # Controls how strictly the model follows the style (1.0-5.0) exaggeration=0.7, # Controls emotional expressiveness (0.0-1.0) audio_format="mp3", # Output format: "wav" or "mp3")