Get Instant Solutions for Kubernetes, Databases, Docker and more
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.
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.
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.
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.
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.
To resolve the LanguageNotSupportedException
, follow these steps:
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.
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"
}
After making the necessary changes, test your application to ensure that the error is resolved and that the speech synthesis is functioning as expected.
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.
(Perfect for DevOps & SREs)
Try Doctor Droid — your AI SRE that auto-triages alerts, debugs issues, and finds the root cause for you.