Added API key in code
authorCedric Godin <cedric.godin@usherbrooke.ca>
Mon, 5 Feb 2018 17:54:46 +0000 (12:54 -0500)
committerCedric Godin <cedric.godin@usherbrooke.ca>
Mon, 5 Feb 2018 17:54:46 +0000 (12:54 -0500)
resources/js/speech-to-text.js
stream-to-text.js

index 9cfbb3d254b36c3823ac360c766c03665dbe9056..a77243d9abd5aa435bc3088badb423ffeb76bd64 100644 (file)
@@ -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) {
index 04dbf0a800acfa7ba914e250dc035f39bf1e8959..09bdf0cc0a53c3cf8efa268cc02145dc7c859eec 100644 (file)
@@ -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";