Skip to content

ValidationException: The selected speech mark type - viseme - is not supported for this engine: generative

0

Trying to generate viseme data for text to speech using SynthesizeSpeechCommand '@aws-sdk/client-polly' for a generative voice

      const visemeCommand = new SynthesizeSpeechCommand({
        Engine:  'generative',
        OutputFormat: 'json',
        LanguageCode: 'en-GB',
        VoiceId: 'Amy',
        Text: 'Hello there',
        TextType: 'text',
        SpeechMarkTypes: ['viseme']
      })

      const data = await this.pollyClient.send(visemeCommand)

throws error ValidationException: The selected speech mark type - viseme - is not supported for this engine: generative

Documentation does not say Speech Marks is not available for generative engine?

if using neural engine I can get viseme data

asked 2 years ago300 views

2 Answers
1
Accepted Answer

You are correct that the generative engine in Amazon Polly does not support speech marks, including viseme data. This is why you're encountering the ValidationException when trying to use the 'viseme' speech mark type with the generative engine.

The generative engine is a newer addition to Amazon Polly and has some limitations compared to the standard and neural engines. One of these limitations is the lack of support for speech marks.

If you need viseme data, you should use either the standard or neural engine instead of the generative engine. As you mentioned, you were able to get viseme data when using the neural engine. This is the correct approach.

To resolve the error and generate viseme data, you should modify your code to use the 'neural' engine instead of 'generative'. Here's how you could adjust your command:

const visemeCommand = new SynthesizeSpeechCommand({
  Engine: 'neural',
  OutputFormat: 'json',
  LanguageCode: 'en-GB',
  VoiceId: 'Amy',
  Text: 'Hello there',
  TextType: 'text',
  SpeechMarkTypes: ['viseme']
})

By changing the Engine parameter to 'neural', you should be able to successfully generate the viseme data for your text-to-speech conversion.

Remember that not all voices are available for all engines, so make sure that the voice you're using (in this case, 'Amy') is supported by the neural engine. If it's not, you may need to choose a different voice that is compatible with the neural engine to get the viseme data.
Sources
Speech mark types - Amazon Polly
Speech Marks - Amazon Polly
SynthesizeSpeech - Amazon Polly

answered 2 years ago

EXPERT

reviewed 2 years ago

0

i see now Speech Marks does have a footnote that says

Speechmarks are available when using either neural or standard text-to-speech formats.

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.