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.
yoshi-automation authored Dec 23, 2020

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
1 parent a6e9bb2 commit 53c2048
Showing 3 changed files with 23 additions and 9 deletions.
12 changes: 4 additions & 8 deletions packages/google-cloud-speech/README.md
Original file line number Diff line number Diff line change
@@ -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',
@@ -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) |
18 changes: 18 additions & 0 deletions packages/google-cloud-speech/samples/README.md
Original file line number Diff line number Diff line change
@@ -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)
@@ -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).
2 changes: 1 addition & 1 deletion packages/google-cloud-speech/synth.metadata
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-speech.git",
"sha": "a2b3adc18434e80862fadf4242fbc6b58f0992be"
"sha": "7369d105e24727f9844e51f504694874258ceac1"
}
},
{

0 comments on commit 53c2048

Please sign in to comment.