From 21105dcda59ce20cde2b44ae0d655268a6ed4bc7 Mon Sep 17 00:00:00 2001 From: Chris Frater Date: Mon, 10 Sep 2018 10:09:04 -0700 Subject: [PATCH] Add streaming microphone sample for Speech (#87) Add streaming microphone sample for Speech --- speech/system-test/MicrophoneStream.test.js | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 speech/system-test/MicrophoneStream.test.js diff --git a/speech/system-test/MicrophoneStream.test.js b/speech/system-test/MicrophoneStream.test.js new file mode 100644 index 00000000000..fa385777deb --- /dev/null +++ b/speech/system-test/MicrophoneStream.test.js @@ -0,0 +1,30 @@ +/** + * Copyright 2016, Google, Inc. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +const path = require(`path`); +const test = require(`ava`); + +const {runAsync} = require(`@google-cloud/nodejs-repo-tools`); +const cmd = `node MicrophoneStream.js`; +const cwd = path.join(__dirname, `..`); + +test(`MicrophoneStream.js Should load and display Yaaaarghs(!) correctly`, async t => { + const output = await runAsync(`${cmd} --help`, cwd); + t.true( + output.includes('Streams audio input from microphone, translates to text') + ); +});