#What are the audio output format parameters in the elevenlabs python library?

1 messages · Page 1 of 1 (latest)

lean oakBOT
#
AI-generated Answer for afkarxyz

The ElevenLabs Python library supports various audio output formats for text-to-speech conversion. According to the API reference, you can specify the output_format parameter when making a text-to-speech request. Here are the available options:

  • mp3_22050_32: MP3 format with 22.05kHz sample rate at 32kbps
  • mp3_44100_32: MP3 format with 44.1kHz sample rate at 32kbps
  • mp3_44100_64: MP3 format with 44.1kHz sample rate at 64kbps
  • mp3_44100_96: MP3 format with 44.1kHz sample rate at 96kbps
  • mp3_44100_128: Default output format, MP3 with 44.1kHz sample rate at 128kbps
  • mp3_44100_192: MP3 format with 44.1kHz sample rate at 192kbps (requires Creator tier or above)
  • pcm_16000: PCM format (S16LE) with 16kHz sample rate
  • pcm_22050: PCM format (S16LE) with 22.05kHz sample rate
  • pcm_24000: PCM format (S16LE) with 24kHz sample rate
  • pcm_44100: PCM format (S16LE) with 44.1kHz sample rate (requires Pro tier or above)
  • ulaw_8000: μ-law format with 8kHz sample rate (commonly used for Twilio audio inputs)

You can use these format options when making a text-to-speech request. For example:

from elevenlabs import ElevenLabs

client = ElevenLabs(api_key="YOUR_API_KEY")

response = client.text_to_speech.convert_with_timestamps(
    voice_id="JBFqnCBsd6RMkjVDRZzb",
    output_format="mp3_44100_128",
    text="Your text here",
    model_id="eleven_multilingual_v2"
)

Remember that some formats may require specific subscription tiers to access.

sharp sigil
#

For the free ones, what are the formats