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

Commit

Permalink
$ npm run generate-scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebecca Taylor committed Mar 23, 2018
1 parent 6eb1ea6 commit 0db5e36
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Expand Up @@ -15,7 +15,7 @@ possible:
- OS:
- Node.js version:
- npm version:
- `text-to-speech` version:
- `@google-cloud/text-to-speech` version:

#### Steps to reproduce

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -4,6 +4,10 @@
.nyc_output
docs/
out/
build/
system-test/secrets.js
system-test/*key.json
*.lock
.DS_Store
google-cloud-logging-winston-*.tgz
google-cloud-logging-bunyan-*.tgz
2 changes: 1 addition & 1 deletion .jsdoc.js
Expand Up @@ -39,7 +39,7 @@ module.exports = {
copyright: 'Copyright 2017 Google, Inc.',
includeDate: false,
sourceFiles: false,
systemName: 'text-to-speech',
systemName: '@google-cloud/text-to-speech',
theme: 'lumen'
}
};
1 change: 1 addition & 0 deletions CONTRIBUTORS
Expand Up @@ -4,3 +4,4 @@
# name <email>
#
Alexander Fenster <fenster@google.com>
Rebecca Taylor <rebeccataylor@google.com>
9 changes: 5 additions & 4 deletions README.md
Expand Up @@ -78,15 +78,16 @@ const text = 'Hello, world!';

// Construct the request
const request = {
input: { text: text },
input: {text: text},
// Select the language and SSML Voice Gender (optional)
voice: { languageCode: 'en-US', ssmlGender: 'NEUTRAL' },
voice: {languageCode: 'en-US', ssmlGender: 'NEUTRAL'},
// Select the type of audio encoding
audioConfig: { audioEncoding: 'MP3' }
audioConfig: {audioEncoding: 'MP3'},
};

// Performs the Text-to-Speech request
client.synthesizeSpeech(request)
client
.synthesizeSpeech(request)
.then(results => {
// The binary audio content returned from the API
const audioContent = results[0].audioContent;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -29,11 +29,12 @@
"Cloud Text-to-Speech API"
],
"contributors": [
"Alexander Fenster <fenster@google.com>"
"Alexander Fenster <fenster@google.com>",
"Rebecca Taylor <rebeccataylor@google.com>"
],
"scripts": {
"test": "repo-tools test run --cmd npm -- run cover",
"generate-scaffolding": "repo-tools generate lib_readme",
"generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json",
"cover": "nyc --reporter=lcov mocha --require intelli-espower-loader test/*.js && nyc report",
"test-no-cover": "repo-tools test run --cmd mocha -- test/*.js --no-timeouts",
"lint": "repo-tools lint --cmd eslint -- src/ samples/ system-test/ test/ smoke-test/",
Expand Down
3 changes: 3 additions & 0 deletions samples/.eslintrc.yml
@@ -0,0 +1,3 @@
---
rules:
no-console: off
88 changes: 88 additions & 0 deletions samples/README.md
@@ -0,0 +1,88 @@
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# Google Cloud Text-To-Speech: Node.js Samples

[![Open in Cloud Shell][shell_img]][shell_link]

Cloud Text-to-Speech API

## Table of Contents

* [Before you begin](#before-you-begin)
* [Samples](#samples)
* [Synthesize Speech](#synthesize-speech)
* [List supported voices](#list-supported-voices)

## Before you begin

Before running the samples, make sure you've followed the steps in the
[Before you begin section](../README.md#before-you-begin) of the client
library's README.

## Samples

### Synthesize Speech

View the [source code][synthesize_speech_0_code].

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-text-to-speech&page=editor&open_in_editor=samples/synthesize.js,samples/README.md)

__Usage:__ `node synthesize.js --help`

```
synthesize.js <command>
Commands:
synthesize.js text <text> Synthesizes audio file from text
synthesize.js ssml <ssml> Synthesizes audio file from SSML
synthesize.js text-file <textFile> Synthesizes audio file from text in a file
synthesize.js ssml-file <ssmlFile> Synthesizes audio file from SSML in a file
Options:
--version Show version number [boolean]
--outputFile, -o [string] [default: "output.mp3"]
--help Show help [boolean]
Examples:
node synthesize.js text "hello" -o hello.mp3
node synthesize.js ssml "<?xml..." -o hello.mp3
node synthesize.js text-file filename.txt -o output.mp3
node synthesize.js ssml-file filename.ssml -o output.mp3
For more information, see https://cloud.google.com/text-to-speech/docs
```

[synthesize_speech_0_docs]: https://cloud.google.com/text-to-speech/docs
[synthesize_speech_0_code]: synthesize.js

### List supported voices

View the [source code][list_voices_1_code].

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-text-to-speech&page=editor&open_in_editor=samples/listVoices.js,samples/README.md)

__Usage:__ `node listVoices.js --help`

```
listVoices.js <command>
Commands:
listVoices.js list-voices List supported voices.
Options:
--version Show version number [boolean]
--help Show help [boolean]
Examples:
node listVoices.js list-voices
For more information, see https://cloud.google.com/text-to-speech/docs
```

[list_voices_1_docs]: https://cloud.google.com/text-to-speech/docs
[list_voices_1_code]: listVoices.js

[shell_img]: //gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-text-to-speech&page=editor&open_in_editor=samples/README.md
6 changes: 6 additions & 0 deletions system-test/.eslintrc.yml
@@ -0,0 +1,6 @@
---
env:
mocha: true
rules:
node/no-unpublished-require: off
no-console: off

0 comments on commit 0db5e36

Please sign in to comment.