Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Speech from '@google-cloud/speech';
import fs from 'fs';
import async from 'async';
import {createOutputStream, getFilePath, getFiles} from './files';
import * as config from './config.json';
const client = Speech();
const options = config.audio;
const files = getFiles(config.path);
const stream = createOutputStream();
const start = () => {
if (!files.length) {
stream.close();
return;
}
const filename = files.shift();
const file = getFilePath(filename);
debug('Recognizing ' + filename);