How to use the @google-cloud/speech function in @google-cloud/speech

To help you get started, we’ve selected a few @google-cloud/speech examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hugmanrique / AudioToText / lib / app.js View on Github external
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);

@google-cloud/speech

Cloud Speech Client Library for Node.js

Apache-2.0
Latest version published 4 months ago

Package Health Score

88 / 100
Full package analysis