From: Cedric Godin Date: Mon, 5 Feb 2018 17:54:46 +0000 (-0500) Subject: Added API key in code X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=d2c90c8b20740aa02c17cc98c1e42708567ff1c6;p=yn%2Fyn-odasweb.git Added API key in code --- diff --git a/resources/js/speech-to-text.js b/resources/js/speech-to-text.js index 9cfbb3d..a77243d 100644 --- a/resources/js/speech-to-text.js +++ b/resources/js/speech-to-text.js @@ -1,7 +1,10 @@ const fs = require('fs'); const speech = require('@google-cloud/speech'); -const client = new speech.SpeechClient(); +const client = new speech.SpeechClient({ + keyFilename: 'google-api-key.json' +}); + const languageCode = "fr-CA"; exports.setLanguage = function(code) { diff --git a/stream-to-text.js b/stream-to-text.js index 04dbf0a..09bdf0c 100644 --- a/stream-to-text.js +++ b/stream-to-text.js @@ -1,7 +1,9 @@ const EventEmitter = require('events'); const speech = require('@google-cloud/speech'); -const client = new speech.SpeechClient(); +const client = new speech.SpeechClient({ + keyFilename: 'google-api-key.json' +}); const languageCode = "fr-CA";