Skip to content

Commit

Permalink
docs: update sample to show method inside of async function (#188)
Browse files Browse the repository at this point in the history
docs: update sample to show method inside of async function
  • Loading branch information
nirupa-kumar authored and JustinBeckwith committed Feb 14, 2019
1 parent 14f173f commit 83cac07
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/google-cloud-texttospeech/samples/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

'use strict';

async function main() {
// [START tts_quickstart]
const fs = require('fs');
const util = require('util');

// Imports the Google Cloud client library
const textToSpeech = require('@google-cloud/text-to-speech');
// [START tts_quickstart]
// Imports the Google Cloud client library
const textToSpeech = require('@google-cloud/text-to-speech');

// Import other required libraries
const fs = require('fs');
const util = require('util');
async function main() {
// Creates a client
const client = new textToSpeech.TextToSpeechClient();

Expand All @@ -44,7 +44,6 @@ async function main() {
const writeFile = util.promisify(fs.writeFile);
await writeFile('output.mp3', response.audioContent, 'binary');
console.log('Audio content written to file: output.mp3');
// [END tts_quickstart]
}

// [END tts_quickstart]
main().catch(console.error);

0 comments on commit 83cac07

Please sign in to comment.