Chirp3 HD Voices don't support markup field in long audio synthesis

I’m trying to put some pauses in my synthesized text-to-speech audio. Since it seems as though the Chirp3 HD voices don’t support SSML :slightly_frowning_face: , I attempted to use the markup functionality described here:

https://cloud.google.com/text-to-speech/docs/chirp3-hd#pause_control

When trying this with the latest (2.25.1) python library, it fails with the following error message:

Unknown field for SynthesisInput: markup

Code:

operation = client.synthesize_long_audio(
  timeout=600,
  request=texttospeech.SynthesizeLongAudioRequest(
    parent=client.common_location_path(
      CONFIG.firebase_project, CONFIG.firebase_location
    ),
    input={"markup": text},
    voice=voice,
    audio_config=audio_config,
    output_gcs_uri=output_url,
  ),
)
return operation.result(timeout=600)

Trying to use synthesize_speech instead, has the same effect

I posted this as well to the python lib: https://github.com/googleapis/google-cloud-python/issues/13737

Ever found a solution?

I’m using Node, and one possibility is to just pass the markup tag. The typechecker complains, but you can silence it with an as any cast.

However, when passing the markup text with some pauses, Google Cloud replies

INVALID_ARGUMENT: Markup features, including pause tags, are only supported for Chirp 3: HD voices

But that was with the voice en-US-Chirp-HD-D - isn’t that a Chirp 3 HD voice?

I didn’t get it working, sorry!

It looks like they have both Chirp3-HD and Chirp-HD that are both under the Chirp voices: Supported voices and languages  |  Text-to-Speech  |  Google Cloud

I got it working by just passing the marker prop. Should be possible in Python too, as it’s a dynamic platform like Node.

About the error - yes of course, I used an older Chirp voice, which does not support the pauses. But the Chirp3 voices do. Works like a charm now.

Awesome! Are you saying you passed in the SSML text to marker instead of markup and it worked as intended?

Exactly. I just passed

{
markup: “Text to encode, [pause short] with a pause”,
}

instead of

{
text: “Text to encode, [pause short] with a pause”,
}

The type checker complained, but there are ways in TypeScript to ignore that. Suppose in Python it’s # type: ignore or something similar.

Ah I see, I thought you were saying the key was different. Yes I had tried that a while back with no luck, I presume they finally fixed it!