Git Product home page Git Product logo

hacktheburgh2019's Introduction

Google Cloud Speech Transcription Demo

This is a demo applicaiton of using Google Cloud Speech API with Nexmo Websockets to perform realtime transcription in multiple languages.

Google Cloud Speech API

You'll need to signup for the Speech API as part of Google Cloud, start here https://console.cloud.google.com/launcher/details/google/speech.googleapis.com

Prerequisites

The application is built in node you will need the following packages:

  • dotenv
  • websocket
  • httpdispatcher
  • url
  • @google-cloud/speech
  • nexmo

These are all specified in the package.json

Once you have enabled the API you'll need to create a project and get a set of credentials, these will be downloaded as a JSON file, save that file as google_creds.json in this project.

Nexmo

You will need to create a Nexmo Voice Applicaiton with the answer url set to [YOURHOSTNAME]/ncco and optionally the event URL set to [YOURHOSTNAME]/event You then need to purchase a number and link that to the applicaiton, you can edit the number that is displayed on the webpage in index.html to match your number.

Configuration

Apart from the Google credentials the only other parameter to configure is the hostname(s) The server needs to listen on 2 separate TCP ports to expose a websocket server for the browser and for the nexmo voice API to connect to, the defaults for this are port 8000 and port 8001. Almost everything is on port 8000 apart from the nexmo websocket connection which uses 8001, you can either run this server using ngrok and your local machine then expose each of the 2 ports under different hostnames or use the same hostname for the machine and just put :8000 & :8001 on the end of the hostnames. These are configured in the .env file.

Running

To start the server execute node ./server.js You can then browse to the root of your hostname and the page should be served, call the number linked to your applicaiton, enter the language code you want to test (e.g. 16 for UK English) and once the language has been confirmed to you start talking. You will see transcription on the right hand side of the page.

hacktheburgh2019's People

Contributors

andreinonea avatar

Watchers

James Cloos avatar Albert Viilik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.