-
Notifications
You must be signed in to change notification settings - Fork 95
Text-to-Speech Code Samples for Listing Voices and Synthesizing Speech #4
Conversation
I can't add @nnegrey or @dizcology as reviewers on this project 😕 @lukesneeringer/@alexander-fenster I need to request reviews from ML API DPEs on some Node.js PRs to approve the ML requirements side of things. Can I get them added to the nodejs repos? They won't ever be the solo reviewer, but they should be able to block merges and request changes. Guessing this requires adding to Node team? |
samples/listVoices.js
Outdated
console.log('Voices:'); | ||
voices.forEach(voice => { | ||
console.log(`Name: ${voice.name}`); | ||
console.log(` SSML Gender: ${voice.ssmlGender}`); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@remi I can add them to this particular repo as contributors but not to the team - you might need to ask @ofrobots to do that. Unrelated note: the |
What precisely is being asked for re: addition:
|
Just having @nnegrey is enough for now, thanks! |
Codecov Report
@@ Coverage Diff @@
## master #4 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 4 4
=====================================
Hits 4 4 Continue to review full report at Codecov.
|
README.md
Outdated
const audioContent = results[0].audioContent; | ||
|
||
// Write the audio content to a local file | ||
fs.writeFileSync('output.mp3', audioContent, 'binary'); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
}); | ||
|
||
test(`should synthesize speech to local mp3 file`, async t => { | ||
t.false(fs.existsSync(outputFile)); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Blocked on #5 |
@alexander-fenster I updated the MP3 file which each snippet writes to do so asynchronously (as you pointed out, while in a > @google-cloud/[email protected] lint /home/node/project
> repo-tools lint --cmd eslint -- src/ samples/ system-test/ test/ smoke-test/
lint: Linting files in: /home/node/project
lint: Running: eslint src/ samples/ system-test/ test/ smoke-test/
/home/node/project/samples/quickstart.js
42:9 error Async functions are not supported yet on Node >=4.0.0 node/no-unsupported-features
47:5 error Async functions are not supported yet on Node >=4.0.0 node/no-unsupported-features
/home/node/project/samples/synthesize.js
39:11 error Async functions are not supported yet on Node >=4.0.0 node/no-unsupported-features
42:7 error Async functions are not supported yet on Node >=4.0.0 node/no-unsupported-features
72:11 error Async functions are not supported yet on Node >=4.0.0 node/no-unsupported-features
75:7 error Async functions are not supported yet on Node >=4.0.0 node/no-unsupported-features
105:11 error Async functions are not supported yet on Node >=4.0.0 node/no-unsupported-features
108:7 error Async functions are not supported yet on Node >=4.0.0 node/no-unsupported-features
138:11 error Async functions are not supported yet on Node >=4.0.0 node/no-unsupported-features
141:7 error Async functions are not supported yet on Node >=4.0.0 node/no-unsupported-features
✖ 10 problems (10 errors, 0 warnings)
lint: Oh no! Linting failed after 1.52s. |
@alexander-fenster @lukesneeringer @jonparrott How do the system-tests for for nodejs-* libraries? These samples are good to merge, but I don't see ./nodejs-text-to-speech/system-tests/ whereas I see it in the other nodejs libraries? IIUC you can configure the generation of these in the gapic.yaml? |
@@ -9,5 +9,21 @@ | |||
"requiresKeyFile": true, | |||
"requiresProjectId": true, | |||
"client_reference_url": "https://cloud.google.com/nodejs/docs/reference/text-to-speech/latest/", | |||
"release_quality": "alpha" | |||
"release_quality": "alpha", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
@@ -43,7 +46,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. | |||
|
|||
[Enable billing][billing] | |||
|
|||
1. Enable the Google Cloud Text-To-Speech API. | |||
1. Enable the Google Cloud Text-to-Speech API API. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Thanks, This PR is amazingly useful. Helped me get off the ground. |
Thanks @JSzaszvari! This fell off of my radar, lemme see if I can get it merged |
@crwilcox This change fails on master because we need to setup samples tests properly. Let's meet together and make the tests run (need to setup an encryption key). |
Add code samples for listing voices and synthesizing speech audio files (from plain text or SSML)
Canonical samples (Python PR):
tts_quickstart
tts_list_voices
tts_synthesize_text
tts_synthesize_ssml
tts_synthesize_text_file
tts_synthesize_ssml_file
Generate Readme
Tests and linter pass
Code coverage does not decrease (if any source code was changed)