googleapis / python-texttospeech

This library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-texttospeech
Apache License 2.0
124 stars 45 forks source link

Listing voices do not show Neural2 models #310

Closed zdhernandez closed 1 year ago

zdhernandez commented 2 years ago

@crwilcox If I hit this endpoint, I can see Neural2 voices listed: https://texttospeech.googleapis.com/v1/voices

But when I call it from Python using the latest text-to-speech version, Neural2 voices don't show up in the response.

I am expecting to see a result like this:
English (Australia) | Neural2 | en-AU | en-AU-Neural2-A | FEMALE

This is the Python example from https://cloud.google.com/text-to-speech/docs/samples/tts-list-voices#tts_list_voices-python

` def list_voices(): from google.cloud import texttospeech

client = texttospeech.TextToSpeechClient()

# Performs the list voices request
voices = client.list_voices()

for voice in voices.voices:
    # Display the voice's name. Example: tpc-vocoded
    print(f"Name: {voice.name}")

    # Display the supported language codes for this voice. Example: "en-US"
    for language_code in voice.language_codes:
        print(f"Supported language: {language_code}")

    ssml_gender = texttospeech.SsmlVoiceGender(voice.ssml_gender)

    # Display the SSML Voice Gender
    print(f"SSML Voice Gender: {ssml_gender.name}")

    # Display the natural sample rate hertz for this voice. Example: 24000
    print(f"Natural Sample Rate Hertz: {voice.natural_sample_rate_hertz}\n")`
zdhernandez commented 2 years ago

@yil532 Also, in the listed voices, this en-US-Neural2-A shows as Female, but when the MP3 is generated using "speech_client.synthesize_speech," it is not a Female voice. The Google Website has it listed as a female, but when you play the audio is a male voice. You can test it here, too: https://cloud.google.com/text-to-speech/docs/voices

This issue is happening with other Neural2 voices where the genders listed in the metadata do not match the final "gender" output of the mp3 audio.

image
zdhernandez commented 1 year ago

@yil532 Any updates on this issue ?

yil532 commented 1 year ago

The doc has been updated. Thank you!

image