Skip to main content

Speech to text transcription in real-time using IBM Watson

Project description

Speech to text transcription from your microphone in real-time using IBM Watson.

Installing

  1. This project depends on PortAudio - a free, cross-platform, open-source, audio I/O library. Install it first.

  2. Prepare your credentials:

    • Visit the IBM Watson projects page.

    • Choose your project.

    • Copy the credentials to credentials.json somewhere on your computer.

  3. pip install watson-streaming and you are ready to go!

Using from the command line

watson-streaming path/to/credentials.json  # And start talking

Using as a library

from watson_streaming import transcribe


# Write whatever you want in your callback function (expecting a dict)
def example_callback(data):
    if 'results' in data:
        transcript = data['results'][0]['alternatives'][0]['transcript']
        print(transcript)


# Provide a dictionary of Watson input and output features.
# For example
settings = {
    'inactivity_timeout': -1,  # Don't kill me after 30 seconds
    'interim_results': True,
}


# You can't ask for a simpler API than this!
transcribe(example_callback, settings, 'credentials.json')

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

watson-streaming-0.0.4.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

watson_streaming-0.0.4-py2.py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page