AWS Polly UnsupportedLanguageException
The specified language is not supported for the selected voice.
Debug error automatically with DrDroid AI →
Connect your tools and ask AI to solve it for you
Understanding AWS Polly
AWS Polly is a service provided by Amazon Web Services that converts text into lifelike speech. It allows developers to create applications that can talk, making it a valuable tool for enhancing user interaction through voice. Polly supports a variety of languages and voices, enabling developers to choose the most suitable voice for their application needs.
Recognizing the Symptom: UnsupportedLanguageException
When using AWS Polly, you might encounter the UnsupportedLanguageException. This error typically manifests when you attempt to synthesize speech using a language that is not supported by the selected voice. The error message will indicate that the language is not compatible with the voice you have chosen.
Explaining the Issue: UnsupportedLanguageException
The UnsupportedLanguageException occurs when there is a mismatch between the language specified in your request and the capabilities of the voice you are trying to use. Each voice in AWS Polly supports specific languages, and attempting to use a voice with an unsupported language will trigger this exception.
Common Causes
- Incorrect language code specified in the request.
- Attempting to use a voice that does not support the desired language.
Steps to Fix the UnsupportedLanguageException
To resolve the UnsupportedLanguageException, follow these steps:
Step 1: Verify Language and Voice Compatibility
Check the AWS Polly documentation to ensure that the language you want to use is supported by the voice you have selected. You can find a list of supported languages and voices in the AWS Polly Voice List.
Step 2: Update Your Request
Modify your request to use a compatible language and voice pair. For example, if you are using the Joanna voice, ensure that your language code is set to en-US for English (US).
{ "Text": "Hello, world!", "VoiceId": "Joanna", "LanguageCode": "en-US"}
Step 3: Test Your Configuration
After updating your request, test the configuration by synthesizing speech again. If the issue persists, double-check the language and voice compatibility.
Additional Resources
For more information on AWS Polly and troubleshooting, visit the AWS Polly Homepage and the AWS Polly Troubleshooting Guide.
Still debugging? Let DrDroid AI investigate for you →
Connect your tools and debug with AI
Get root cause analysis in minutes
- Connect your existing monitoring tools
- Ask AI to debug issues automatically
- Get root cause analysis in minutes