GithubHelp home page GithubHelp logo

wcreis / voice-ibm-speechtotext-py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nexmo-community/voice-ibm-speechtotext-py

0.0 0.0 0.0 5 KB

Transcribe audio from a Call using IBM Watson

Python 100.00%

voice-ibm-speechtotext-py's Introduction

Example code for connecting a Nexmo Voice API call to IBM Watson via websockets

You can use this code as a base for doing real time transcription on a phone call using IBM Watsons Speech to Text API.

The Audio stream is sent over a websocket to your server and you then relay that on to the Watson websocket interface, Watson replies on the same connction with transcription responses.

Running the example

To run this on your machine you'll need an up-to-date version of Python 2. Install dependencies with:

pip install --upgrade -r requirements.txt

You'll need to edit the server.py file to add in your own service credentials from watson and also specify the hostname where your machine is running, tools like ngrok are great for exposing your local machine to the internet.

By default the server runs on port 8000

You will also need to set the correct speech model, we reccomend for all phone calls you use Narrowband Audio.

Run the server like this:

python ./server.py 

Linking to Nexmo

You will need to create a new application with the Nexmo CLI and set the answer_url as http://[YOUR HOSTNAME]/ncco and the event_url as http://[YOUR HOSTNAME]/event The server will return an appropriate NCCO. Link a number to your application and then when you call the number you will be connected throgh to Watson, simply start talking and you should see results printed to the console.

Extending

This example code simply prints the reponses from Watson to the console, however to integrate it with your own applicaiton you should extend the on_watson_message function in server.py

voice-ibm-speechtotext-py's People

Contributors

sammachin avatar martyndavies avatar leggetter 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.