Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SSML for text-to-speech #66

Closed
MarkEdmondson1234 opened this issue Apr 11, 2020 · 2 comments
Closed

Support SSML for text-to-speech #66

MarkEdmondson1234 opened this issue Apr 11, 2020 · 2 comments

Comments

@MarkEdmondson1234
Copy link
Collaborator

Add endpoint:
https://cloud.google.com/text-to-speech/docs/ssml

@MarkEdmondson1234
Copy link
Collaborator Author

Add ssml option to the body object and add an option:

body <- list(
input = list(
text = input
),
voice = list(
languageCode = languageCode,
name = name,
ssmlGender = gender
),
audioConfig = list(
audioEncoding = audioEncoding,
speakingRate = speakingRate,
pitch = pitch,
volumeGainDb = volumeGainDb,
sampleRateHertz = sampleRateHertz
)
)

MarkEdmondson1234 added a commit that referenced this issue Apr 11, 2020
@MarkEdmondson1234
Copy link
Collaborator Author

MarkEdmondson1234 commented Apr 11, 2020

This is working for me now - I added an argument "inputType" which accepts "text" or "ssml"

gl_talk('<speak>The <say-as interpret-as=\"characters\">SSML</say-as>
          standard <break time=\"1s\"/>is defined by the
          <sub alias=\"World Wide Web Consortium\">W3C</sub>.</speak>', 
          inputType =  "ssml")

Please install via remotes::install_github("ropensci/googleLanguageR") and test it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant