{
"input": {
"ssml": "<p><s>Piso en venta por 298.750 euros</s><s>Moderno apartamento en Benalmádena con amplias vistas al mar y terraza privada</s><s>Cerca de la playa y servicios</s><s>¡Llámanos ya!</s></p>"
},
"voice": {
"languageCode": "es-ES"
},
"audioConfig": {
"audioEncoding": "LINEAR16",
"effectsProfileId": [
"handset-class-device"
]
}
}
when i generate the audio it ignores all sorts of punctuation like </s><s> or <break time="500ms"/>
Hi @diegolarraa,
Welcome to Google Cloud Community!
I tried to replicate the issue you've encountered but the result on my end seems ok. There is a pause after euros, privada and servicios. Here's what I did which you can try on your end:
1. I used the command line to perform the Text-to-Speech API and run the following code based on the documentation though I used API key instead of access token:
curl -H "X-Goog-Api-Key: <INPUT_YOUR_API_KEY_HERE>" \
-H "Content-Type: application/json; charset=utf-8" \
--data "{
'input':{
'ssml':'<p><s>Piso en venta por 298.750 euros</s><s>Moderno apartamento en Benalmádena con amplias vistas al mar y terraza privada</s><s>Cerca de la playa y servicios</s><s>¡Llámanos ya!</s></p>'
},
'voice':{
'languageCode':'es-ES',
},
'audioConfig':{
'audioEncoding':'LINEAR16',
'effectsProfileId': ['handset-class-device']
}
}" "https://texttospeech.googleapis.com/v1/text:synthesize" > synthesize-text.txt
To create an API key, you may follow the steps mentioned in the documentation. This step will create a file named synthesize-text.txt. Open the file and copy the contents of the audioContent field into a new file and name it as synthesize-output-base64.txt.
2. Decode the contents of the synthesize-output-base64.txt file into a new file named synthesized-audio.mp3 then run the command to decode it based on your environment or device.
3. Open the audio file and see if you'll get the same result
As a best practice, avoid using SSML reserve characters (e.g ") in the text that is to be converted to audio. For more information about reserve characters, you may check our documentation.
I hope this helps.
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |