Skip to content

Commit 83cac07

Browse files
nirupa-kumarJustinBeckwith
authored andcommitted
docs: update sample to show method inside of async function (#188)
docs: update sample to show method inside of async function
1 parent 14f173f commit 83cac07

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

+8-9
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
'use strict';
1717

18-
async function main() {
19-
// [START tts_quickstart]
20-
const fs = require('fs');
21-
const util = require('util');
22-
23-
// Imports the Google Cloud client library
24-
const textToSpeech = require('@google-cloud/text-to-speech');
18+
// [START tts_quickstart]
19+
// Imports the Google Cloud client library
20+
const textToSpeech = require('@google-cloud/text-to-speech');
2521

22+
// Import other required libraries
23+
const fs = require('fs');
24+
const util = require('util');
25+
async function main() {
2626
// Creates a client
2727
const client = new textToSpeech.TextToSpeechClient();
2828

@@ -44,7 +44,6 @@ async function main() {
4444
const writeFile = util.promisify(fs.writeFile);
4545
await writeFile('output.mp3', response.audioContent, 'binary');
4646
console.log('Audio content written to file: output.mp3');
47-
// [END tts_quickstart]
4847
}
49-
48+
// [END tts_quickstart]
5049
main().catch(console.error);

0 commit comments

Comments
 (0)