Skip to content

Commit

Permalink
docs: update list of available samples (#688)
Browse files Browse the repository at this point in the history
autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.
  • Loading branch information
yoshi-automation authored Dec 23, 2020
1 parent 9368c27 commit a6e859e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
12 changes: 4 additions & 8 deletions packages/google-cloud-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,17 @@ npm install @google-cloud/speech
```javascript
// Imports the Google Cloud client library
const speech = require('@google-cloud/speech');
const fs = require('fs').promises;

// Creates a client
const client = new speech.SpeechClient();

async function quickstart() {
// The name of the audio file to transcribe
const fileName = './resources/audio.raw';

// Reads a local audio file and converts it to base64
const file = await fs.readFile(fileName);
const audioBytes = file.toString('base64');
// The path to the remote LINEAR16 file
const gcsUri = 'gs://cloud-samples-data/speech/brooklyn_bridge.raw';

// The audio file's encoding, sample rate in hertz, and BCP-47 language code
const audio = {
content: audioBytes,
uri: gcsUri,
};
const config = {
encoding: 'LINEAR16',
Expand Down Expand Up @@ -109,6 +104,7 @@ has instructions for running the samples.
| Microphone stream | [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/MicrophoneStream.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/MicrophoneStream.js,samples/README.md) |
| Beta Features | [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/betaFeatures.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/betaFeatures.js,samples/README.md) |
| Infinite Streaming | [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/infiniteStreaming.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/infiniteStreaming.js,samples/README.md) |
| Multi Region | [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/multiRegion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/multiRegion.js,samples/README.md) |
| Profanity Filter | [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/profanityFilter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/profanityFilter.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
| Recognize | [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/recognize.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/recognize.js,samples/README.md) |
Expand Down
18 changes: 18 additions & 0 deletions packages/google-cloud-node/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* [Microphone stream](#microphone-stream)
* [Beta Features](#beta-features)
* [Infinite Streaming](#infinite-streaming)
* [Multi Region](#multi-region)
* [Profanity Filter](#profanity-filter)
* [Quickstart](#quickstart)
* [Recognize](#recognize)
Expand Down Expand Up @@ -91,6 +92,23 @@ __Usage:__



### Multi Region

View the [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/multiRegion.js).

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

__Usage:__


`node samples/multiRegion.js`


-----




### Profanity Filter

View the [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/profanityFilter.js).
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-node/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-speech.git",
"sha": "a2b3adc18434e80862fadf4242fbc6b58f0992be"
"sha": "7369d105e24727f9844e51f504694874258ceac1"
}
},
{
Expand Down

0 comments on commit a6e859e

Please sign in to comment.