Created
August 19, 2020 00:15
-
-
Save chck/e58e920b8eeb5e7106479ab5998420f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p voices | |
curl -X POST https://texttospeech.googleapis.com/v1/text:synthesize \ | |
-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ | |
-H "Content-Type: application/json; charset=utf-8" \ | |
-d @- << EOF | jq ".audioContent" | sed -e 's/^"//' -e 's/"$//' > /tmp/synthesize-output-base64.txt | |
{ | |
"input":{ | |
"text":"以上になります、ご清聴ありがとうございました。何でもお気軽にご質問ください" | |
}, | |
"voice":{ | |
"languageCode":"ja-JP", | |
"name":"ja-JP-Standard-C", | |
"ssmlGender":"MALE" | |
}, | |
"audioConfig":{ | |
"audioEncoding":"MP3" | |
} | |
} | |
EOF | |
base64 /tmp/synthesize-output-base64.txt --decode > voices/synthesized-audio.mp3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment