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
This project depends on PortAudio - a free, cross-platform, open-source, audio I/O library. Install it first.
Prepare your credentials:
Visit the IBM Watson projects page.
Choose your project.
Copy the credentials to credentials.json somewhere on your computer.
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
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')
Project details
Release history Release notifications | RSS feed
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.3.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for watson_streaming-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 501bfc8605fa038ccbe456aff0c50fe7ce27ca9eccc64abf36f13839dc4095be |
|
MD5 | 714c19b2f9077a8a956c0e22061a4ca0 |
|
BLAKE2b-256 | 10dec85029b8dc821ad41ff5e2fd46d19279b80f4bb17d7985198cfccb1425db |