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. Download the credentials.json file from IBM Watson and put it in your current working directory.

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

Using from the command line

watson-streaming  # And start talking

Using as a library

from watson_streaming import transcribe


# Write whatever you want in your callback function
def example_callback(msg):
    msg = json.loads(msg)
    if 'results' in msg:
        transcript = msg['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')

Project details


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.2.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distributions

watson_streaming-0.0.2-py2.py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 2 Python 3

watson_streaming-0.0.2-py2.7.egg (6.1 kB view hashes)

Uploaded Source

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