#Hi, how I can choose language in api generated

1 messages · Page 1 of 1 (latest)

opaque ibexBOT
#
AI-generated Answer for kmax_watermelon

The language in the API is determined by the text you provide for the AI to speak. You don't select a specific language, instead, you write in the language you want the AI to speak, and the AI understands automatically. However, it's recommended to use a cloned voice that was cloned speaking the language with the correct accent for optimal results.

The Turbo v2.5 model has an experimental feature, available via API only, which allows you to specify the language code for your generation. Please see the API Reference for full details. As this is an experimental feature, results may vary. This feature is not available for other models, and providing a language code in API calls using other models will return an error.

Here is a Python example of how to use the API:

from elevenlabs.client import ElevenLabs

client = ElevenLabs(
    api_key="YOUR_API_KEY",
)

client.speech_to_speech.convert(
    voice_id="string",
    enable_logging="0",
    optimize_streaming_latency="mp3_22050_32",
    output_format="string",
)

In this example, replace "YOUR_API_KEY" with your actual API key, and the other parameters as needed. The voice_id is the ID of the voice to be used, enable_logging is a boolean that determines whether logging is enabled, optimize_streaming_latency is the output format, and output_format is the desired output format of the generated audio.

granite fable
#

give an example of code with code selection when generating a turbo in the api by the model