Metadata-Version: 2.0
Name: watson-streaming
Version: 0.0.3
Summary: Speech to text transcription in real-time using IBM Watson
Home-page: https://github.com/Nagasaki45/watson-streaming
Author: Tom Gurion
Author-email: nagasaki45@gmail.com
License: UNKNOWN
Description-Content-Type: UNKNOWN
Keywords: ibm watson stt
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Multimedia :: Sound/Audio :: Capture/Recording
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Dist: requests
Requires-Dist: sounddevice
Requires-Dist: websocket-client

watson-streaming
################

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!

.. _PortAudio: http://www.portaudio.com/
.. _`IBM Watson projects`: https://console.bluemix.net/developer/watson/projects

Using from the command line
---------------------------

.. code-block:: bash

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


Using as a library
------------------

.. code-block:: python

    import json

    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')


