Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Text-to-Speech Code Samples for Listing Voices and Synthesizing Speech #4

Merged
merged 32 commits into from
Apr 27, 2018

Conversation

beccasaurus
Copy link
Contributor

@beccasaurus beccasaurus commented Mar 23, 2018

Add code samples for listing voices and synthesizing speech audio files (from plain text or SSML)

Canonical samples (Python PR):

@beccasaurus
Copy link
Contributor Author

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?

console.log('Voices:');
voices.forEach(voice => {
console.log(`Name: ${voice.name}`);
console.log(` SSML Gender: ${voice.ssmlGender}`);

This comment was marked as spam.

@alexander-fenster
Copy link
Contributor

@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 lint task seems to be failing because it's not properly configured in .circleci/config.yml - you can grab the lint steps from any project with existing samples, or let me know if you want me to do it.

@ofrobots
Copy link

What precisely is being asked for re: addition:

  • Add @nnegrey and @dizcology so that they can review code? Anyone can leave review comments, so just mentioning them (as has already been done) is adequate.
  • Add said folks as collaborators so that they can officially sign-off on code reviews. @alexander-fenster can do that. Note that this will also grant them write permissions to the code; so the expectation would be that they are 'code owners' in this repo if we go this route.
  • Add said folks to a new github 'team'. This is the same as the previous bullet, except that it additionally gives you a single team-name that you can use. I seem to have adequate permission to be able to do this. We do get slightly more control as a team can be given either Read or Write permissions.

@beccasaurus
Copy link
Contributor Author

Just having @nnegrey is enough for now, thanks!

@codecov-io
Copy link

codecov-io commented Mar 24, 2018

Codecov Report

Merging #4 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #4   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines           4      4           
=====================================
  Hits            4      4

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b01b2a...cb32701. Read the comment docs.

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.

This comment was marked as spam.

This comment was marked as spam.

});

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.

@beccasaurus beccasaurus changed the title [DO NOT MERGE] Text-to-Speech Code Samples for Listing Voices and Synthesizing Speech [DO NOT MERGE] Text-to-Speech Code Samples for Listing Voices and Synthesizing Speech [BLOCKED pending Library System Tests] Mar 24, 2018
@beccasaurus
Copy link
Contributor Author

Blocked on #5

@beccasaurus
Copy link
Contributor Author

@alexander-fenster I updated the MP3 file which each snippet writes to do so asynchronously (as you pointed out, while in a .then() we may as well .then(async r =>) but now I get complaints from the linter about this:

> @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.

https://circleci.com/gh/googleapis/nodejs-text-to-speech/167?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

@beccasaurus beccasaurus changed the title [DO NOT MERGE] Text-to-Speech Code Samples for Listing Voices and Synthesizing Speech [BLOCKED pending Library System Tests] Text-to-Speech Code Samples for Listing Voices and Synthesizing Speech [BLOCKED pending Library System Tests] Mar 26, 2018
@beccasaurus
Copy link
Contributor Author

@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.

@jmdobry jmdobry mentioned this pull request Mar 28, 2018
@beccasaurus beccasaurus changed the title Text-to-Speech Code Samples for Listing Voices and Synthesizing Speech [BLOCKED pending Library System Tests] Text-to-Speech Code Samples for Listing Voices and Synthesizing Speech Mar 28, 2018
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.

@JSzaszvari
Copy link

Thanks, This PR is amazingly useful. Helped me get off the ground.

@beccasaurus
Copy link
Contributor Author

Thanks @JSzaszvari! This fell off of my radar, lemme see if I can get it merged

@beccasaurus beccasaurus merged commit 3a3fc71 into master Apr 27, 2018
@beccasaurus beccasaurus deleted the samples branch April 27, 2018 03:31
@alexander-fenster
Copy link
Contributor

@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).

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

Successfully merging this pull request may close these issues.

8 participants