AWS Polly SpeechMarkTypeNotSupportedException

The requested speech mark type is not supported for the selected voice.

Resolving SpeechMarkTypeNotSupportedException in AWS Polly

Understanding AWS Polly

AWS Polly is a cloud-based service that converts text into lifelike speech, enabling developers to create applications that can talk. It is part of Amazon Web Services and is widely used for creating voice-enabled applications, enhancing accessibility, and generating audio content.

Identifying the Symptom

When using AWS Polly, you might encounter the error SpeechMarkTypeNotSupportedException. This error typically occurs when a request is made for a speech mark type that is not supported by the selected voice.

What You Observe

During the execution of your application, you may receive an error message indicating that the speech mark type is not supported. This can halt the speech synthesis process and prevent your application from functioning as expected.

Exploring the Issue

The SpeechMarkTypeNotSupportedException is raised when there is a mismatch between the requested speech mark types and the capabilities of the chosen voice. Speech marks are metadata that provide information about the speech, such as word boundaries and sentence breaks, which can be useful for applications requiring precise control over speech output.

Common Causes

  • Requesting unsupported speech mark types for a specific voice.
  • Using a voice that does not support any speech marks.

Steps to Fix the Issue

To resolve the SpeechMarkTypeNotSupportedException, follow these steps:

1. Review Supported Speech Marks

Check the AWS Polly documentation to determine which speech mark types are supported by the voice you are using. You can find this information in the AWS Polly Speech Marks Documentation.

2. Modify Your Request

Adjust your request to include only the supported speech mark types. For example, if you are using a voice that supports only 'word' and 'sentence' speech marks, ensure your request does not include unsupported types like 'ssml'.

{
"OutputFormat": "json",
"Text": "Hello, world!",
"VoiceId": "Joanna",
"SpeechMarkTypes": ["word", "sentence"]
}

3. Choose a Different Voice

If your application requires specific speech marks that are not supported by the current voice, consider selecting a different voice that supports the desired speech marks. Refer to the AWS Polly Voice List for a comprehensive list of voices and their capabilities.

Conclusion

By understanding the capabilities of AWS Polly voices and adjusting your requests accordingly, you can effectively resolve the SpeechMarkTypeNotSupportedException and ensure smooth operation of your voice-enabled applications. For further assistance, consult the AWS Support 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