Skip to content

Instantly share code, notes, and snippets.

@aled1027
Created July 31, 2025 17:38
Show Gist options
  • Select an option

  • Save aled1027/f9eb4bd342467f7479aed1b7799d91f1 to your computer and use it in GitHub Desktop.

Select an option

Save aled1027/f9eb4bd342467f7479aed1b7799d91f1 to your computer and use it in GitHub Desktop.
gemini instructions
  1. Go to the cloud, select your project
  2. Go to API & Services > credentials, generate an API key
  3. Give the API key access to all services
  4. Enable https://console.cloud.google.com/apis/library/texttospeech.googleapis.com?project=compass-436221&pli=1&inv=1&invt=Ab4Plg
  5. Use the following request
curl -X POST -H "Content-Type: application/json" \
-H "x-goog-api-key: GOOGLE_API_KEY" \
--data '{
"input": {
"markup": "Buenos dias"
},
"voice": {
"languageCode": "es-ES",
"name": "es-ES-Chirp3-HD-Schedar",
"voiceClone": {}
},
"audioConfig": {
"audioEncoding": "LINEAR16",
"speakingRate": 0.85
}
}' "https://texttospeech.googleapis.com/v1/text:synthesize"
  1. Convert the output to an audio file: cat response.json | jq -r '.audioContent' | base64 -D > decoded.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment