Hello,
I'm using the Google Cloud Text-to-Speech API in Python, and until recently, I was getting a specific French voice by default without specifying the name attribute. Suddenly, the default voice changed. I've tested all available French options but can't seem to retrieve the previous voice. How can I restore the old configuration (perhaps by specifying the name attribute)?
Thanks in advance!
```
def main(lang, ssml, ofile):
synthesis_input = texttospeech.SynthesisInput(ssml = ssml)
voice = texttospeech.VoiceSelectionParams(
language_code=lang, ssml_gender=texttospeech.SsmlVoiceGender.FEMALE)
audio_config = texttospeech.AudioConfig(
audio_encoding=texttospeech.AudioEncoding.LINEAR16, sample_rate_hertz=8000)
response = client.synthesize_speech(request={"input": synthesis_input, "voice": voice, "audio_config": audio_config})
with open(ofile, 'wb') as out:
out.write(audioop.lin2alaw(response.audio_content[42:], 2))
main('fr-FR', '<speak>ceci est un test</speak>', '/tmp/test.al')
```
Hi @xiaboy,
Welcome to Google Cloud Community!
Here are some approaches that you may try:
First, you need to determine the name of the voice you want to use. Use the list_voices method in the Text-to-Speech API to get a list of available voices for the fr-FR language code. This will provide the voice name you need. Print the voice details to inspect. Look for characteristics that match the voice you used to have (e.g., WaveNet vs. standard, specific accent characteristics). You can also find the complete list of voices and languages available on the Supported Voices and Languages page.
Once you've identified the correct voice name, modify your main function to include the name attribute in the VoiceSelectionParams.
Remember to install the google-cloud-texttospeech library: pip install google-cloud-texttospeech. Also, make sure you have authentication setup correctly for Google Cloud APIs.
If the issue persists, contact Google Cloud Support. They have better visibility into the underlying system and can assist you with specific issues. Also, I suggest filing a defect report. This way you could have visibility on the progress of your request as it is publicly available. Please note that I can't provide any details or timelines at this moment. For future updates, I suggest keeping an eye out on the issue tracker.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hi @ruthseki ,
I think my problem is that the sound I'm looking for no longer exists.
https://services.google.com/fh/files/emails/b_362612430_reminder_1.pdf?hl=fr
Google decided to replace all its sounds on January 27, which is exactly when my issue started. The problem is that my application relies on multiple sound files, and I don’t have the original text or the associated languages to reliably regenerate them.
There are solutions like Whisper or others, but they will never be as accurate as having the original text.
I'm stuck, and so are my clients, as they now have concatenated sounds mixing the new and old voice versions.
I don't think there's a truly reliable solution.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |