Skip to content

Commit dc4f303

Browse files
kweinmeistergcf-owl-bot[bot]sofisl
authored
chore: delete transferred samples (#263)
* chore: delete transferred samples * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * build: update package.json to ignore samples folder Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Sofia Leon <[email protected]>
1 parent e78b639 commit dc4f303

File tree

6 files changed

+2
-334
lines changed

6 files changed

+2
-334
lines changed

packages/google-cloud-mediatranslation/README.md

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
3131
* [Quickstart](#quickstart)
3232
* [Before you begin](#before-you-begin)
3333
* [Installing the client library](#installing-the-client-library)
34-
* [Using the client library](#using-the-client-library)
35-
* [Samples](#samples)
34+
35+
3636
* [Versioning](#versioning)
3737
* [Contributing](#contributing)
3838
* [License](#license)
@@ -54,94 +54,6 @@ npm install @google-cloud/media-translation
5454
```
5555

5656

57-
### Using the client library
58-
59-
```javascript
60-
const fs = require('fs');
61-
62-
// Imports the CLoud Media Translation client library
63-
const {
64-
SpeechTranslationServiceClient,
65-
} = require('@google-cloud/media-translation');
66-
67-
// Creates a client
68-
const client = new SpeechTranslationServiceClient();
69-
70-
async function quickstart() {
71-
/**
72-
* TODO(developer): Uncomment the following lines before running the sample.
73-
*/
74-
// const filename = 'Local path to audio file, e.g. /path/to/audio.raw';
75-
// const encoding = 'Encoding of the audio file, e.g. LINEAR16';
76-
// const sourceLanguage = 'BCP-47 source language code, e.g. en-US';
77-
// const targetLanguage = 'BCP-47 target language code, e.g. es-ES';
78-
79-
const config = {
80-
audioConfig: {
81-
audioEncoding: encoding,
82-
sourceLanguageCode: sourceLanguage,
83-
targetLanguageCode: targetLanguage,
84-
},
85-
};
86-
87-
// First request needs to have only a streaming config, no data.
88-
const initialRequest = {
89-
streamingConfig: config,
90-
audioContent: null,
91-
};
92-
93-
const readStream = fs.createReadStream(filename, {
94-
highWaterMark: 4096,
95-
encoding: 'base64',
96-
});
97-
98-
const chunks = [];
99-
readStream
100-
.on('data', chunk => {
101-
const request = {
102-
streamingConfig: config,
103-
audioContent: chunk.toString(),
104-
};
105-
chunks.push(request);
106-
})
107-
.on('close', () => {
108-
// Config-only request should be first in stream of requests
109-
stream.write(initialRequest);
110-
for (let i = 0; i < chunks.length; i++) {
111-
stream.write(chunks[i]);
112-
}
113-
stream.end();
114-
});
115-
116-
const stream = client.streamingTranslateSpeech().on('data', response => {
117-
const {result} = response;
118-
if (result.textTranslationResult.isFinal) {
119-
console.log(
120-
`\nFinal translation: ${result.textTranslationResult.translation}`
121-
);
122-
console.log(`Final recognition result: ${result.recognitionResult}`);
123-
} else {
124-
console.log(
125-
`\nPartial translation: ${result.textTranslationResult.translation}`
126-
);
127-
console.log(`Partial recognition result: ${result.recognitionResult}`);
128-
}
129-
});
130-
131-
132-
```
133-
134-
135-
136-
## Samples
137-
138-
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-media-translation/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
139-
140-
| Sample | Source Code | Try it |
141-
| --------------------------- | --------------------------------- | ------ |
142-
| Quickstart | [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
143-
| Translate_from_file | [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/translate_from_file.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_file.js,samples/README.md) |
144-
| Translate_from_mic | [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/translate_from_mic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_mic.js,samples/README.md) |
14557

14658

14759

packages/google-cloud-mediatranslation/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
"test": "c8 mocha build/test",
2323
"fix": "gts fix",
2424
"lint": "gts check",
25-
"prelint": "cd samples; npm link ../; npm install",
26-
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
2725
"precompile": "gts clean"
2826
},
2927
"dependencies": {

packages/google-cloud-mediatranslation/samples/README.md

Lines changed: 0 additions & 86 deletions
This file was deleted.

packages/google-cloud-mediatranslation/samples/package.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/google-cloud-mediatranslation/samples/quickstart.js

Lines changed: 0 additions & 101 deletions
This file was deleted.

packages/google-cloud-mediatranslation/samples/test/quickstart.test.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)