AWS Polly LanguageNotSupportedException

The specified language is not supported by AWS Polly.

Understanding AWS Polly

AWS Polly is a service provided by Amazon Web Services that turns text into lifelike speech, allowing developers to create applications that can 'speak' to users. It supports a wide range of languages and voices, making it a versatile tool for creating voice-enabled applications.

Identifying the Symptom

When using AWS Polly, you might encounter an error message stating LanguageNotSupportedException. This error indicates that the language you are trying to use for text-to-speech synthesis is not supported by AWS Polly.

What You Observe

Typically, this error will manifest as a failed API call with the error message clearly stating that the language is not supported. This can halt the functionality of your application if it relies on speech synthesis for user interaction.

Details About the Issue

The LanguageNotSupportedException error occurs when the language code specified in your request is not among the languages supported by AWS Polly. Each language has specific voices associated with it, and not all languages are available in every AWS region.

Understanding Language Support

To avoid this error, it's crucial to refer to the AWS Polly Supported Languages and Voices documentation. This resource provides a comprehensive list of languages and voices available for use.

Steps to Fix the Issue

To resolve the LanguageNotSupportedException, follow these steps:

Step 1: Verify Language Support

Check the AWS Polly documentation to ensure that the language you intend to use is supported. You can find the list of supported languages and voices here.

Step 2: Modify Your Request

Once you have confirmed the supported languages, modify your API request to use a supported language code. For example, if you initially used a language code like fr-CA (Canadian French) which is not supported, switch to fr-FR (French) if it is supported.

{
"OutputFormat": "mp3",
"Text": "Hello, world!",
"VoiceId": "Joanna",
"LanguageCode": "en-US"
}

Step 3: Test Your Application

After making the necessary changes, test your application to ensure that the error is resolved and that the speech synthesis is functioning as expected.

Conclusion

By ensuring that you are using a supported language and voice, you can effectively resolve the LanguageNotSupportedException error in AWS Polly. For more information on AWS Polly and its capabilities, visit the official AWS Polly page.

Try DrDroid: AI Agent for Debugging

80+ monitoring tool integrations
Long term memory about your stack
Locally run Mac App available

Thank you for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.
Read more
Time to stop copy pasting your errors onto Google!

Try DrDroid: AI for Debugging

80+ monitoring tool integrations
Long term memory about your stack
Locally run Mac App available

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

Thank you for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.
Read more
Time to stop copy pasting your errors onto Google!

MORE ISSUES

Deep Sea Tech Inc. — Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid