diff --git a/functions/extractAudio.js b/functions/extractAudio.js index 2e507e6..c87a741 100644 --- a/functions/extractAudio.js +++ b/functions/extractAudio.js @@ -1,11 +1,12 @@ const storageUtils = require('../utils/storage-utils'); const ffmpegUtils = require('../utils/ffmpeg-utils'); module.exports = (event) => { + console.log(`event.data ${JSON.stringify(event)}`); return Promise.resolve() .then(() => { - const videoFile = storageUtils.videoBucket.file(event.data.name); + const videoFile = storageUtils.videoBucket.file(event.name); console.log('downloading video file 2...'); - return storageUtils.downloadFile(videoFile, event.data.name); + return storageUtils.downloadFile(videoFile, event.name); }).then((fileinfo) => { //extract audio and transcode to FLAC return ffmpegUtils.extractAudio(fileinfo); diff --git a/functions/transcribeAudio.js b/functions/transcribeAudio.js index 3c0e38a..8c2b32a 100644 --- a/functions/transcribeAudio.js +++ b/functions/transcribeAudio.js @@ -3,12 +3,12 @@ const path = require('path'); const storageUtils = require('../utils/storage-utils'); const speechUtils = require('../utils/speech-utils'); module.exports = (event) => { - console.log(`event.data ${JSON.stringify(event.data)}`); + console.log(`event.data ${JSON.stringify(event)}`); let audioFileNameWithoutExtension; return Promise.resolve() .then(() => { - console.log(`event.data.name: ${JSON.stringify(event.data.name)}`); - const audioFile = storageUtils.flacBucket.file(event.data.name); + console.log(`event.data.name: ${JSON.stringify(event.name)}`); + const audioFile = storageUtils.flacBucket.file(event.name); const audioFilePath = storageUtils.getFilePathFromFile(audioFile); console.log(`audioFilePath: ${JSON.stringify(audioFilePath)}`); audioFileNameWithoutExtension = path.parse(audioFilePath).name; @@ -16,7 +16,8 @@ module.exports = (event) => { "config": { "enableWordTimeOffsets": true, "languageCode": "en-US", - "encoding": "FLAC" + "encoding": "FLAC", + "audioChannelCount": 1 }, "audio": { "uri": audioFilePath