Get Instant Solutions for Kubernetes, Databases, Docker and more
AWS Polly is a cloud-based service provided by Amazon Web Services that converts text into lifelike speech. It allows developers to create applications that can 'speak' in a variety of voices and languages, enhancing user interaction with voice-enabled applications. AWS Polly is widely used in applications such as news reading, e-learning platforms, and any other service that benefits from text-to-speech capabilities.
When using AWS Polly, you might encounter the error MarksNotSupportedForFormatException
. This error typically arises when you attempt to request speech marks for an output format that does not support them. Speech marks provide metadata about the speech, such as word boundaries, which can be useful for synchronizing animations or highlighting text as it is spoken.
The MarksNotSupportedForFormatException
error indicates that the output format you have chosen does not support speech marks. AWS Polly supports speech marks only for certain output formats, such as JSON. If you attempt to use an unsupported format, this error will be triggered, interrupting the text-to-speech conversion process.
To avoid this error, ensure that you are using a format that supports speech marks. Currently, JSON is the primary format that supports this feature. For more information on supported formats, you can refer to the AWS Polly Documentation.
To resolve the MarksNotSupportedForFormatException
, follow these steps:
Check the output format specified in your AWS Polly request. Ensure that it is set to a format that supports speech marks, such as JSON. Here is an example of how to specify the output format in your request:
{
"OutputFormat": "json",
"Text": "Hello, world!",
"VoiceId": "Joanna",
"SpeechMarkTypes": ["word"]
}
If your current format does not support speech marks, modify your request to use JSON. This change will enable you to receive speech marks metadata along with the synthesized speech.
After making the necessary changes, test your configuration to ensure that the error is resolved. You can use the AWS CLI or SDKs to send a test request and verify the output. For more detailed instructions, visit the AWS Polly Getting Started Guide.
By ensuring that your output format supports speech marks, you can effectively resolve the MarksNotSupportedForFormatException
error in AWS Polly. This will allow you to leverage the full potential of AWS Polly's text-to-speech capabilities, enhancing your application's user experience.
(Perfect for DevOps & SREs)
Try Doctor Droid — your AI SRE that auto-triages alerts, debugs issues, and finds the root cause for you.