Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Continuous speech to text using watson in python with websocket and record from microphone

License

NotificationsYou must be signed in to change notification settings

TeamNutBoltu/stt-watson

 
 

Repository files navigation

Continuous speech to text using watson in python with websocket and record from microphone

Requirements

  • Python 2.7
  • Pip
  • portaudio, can be installed withbrew install portaudio (mac) orapt-get install portaudio19-dev(linux)

Installation

Install with pip:pip install stt-watson

Run the playground

Simply run in command line:stt-watson

At the first launch it will create a config file located to~/.config-stt-watson.yml and ask you your watson credentials

Usage for developers

Bootstrap example:

fromstt_watson.SttWatsonimportSttWatsonfromstt_watson.SttWatsonAbstractListenerimportSttWatsonAbstractListener"""Example of listener to use data given by stt-watson (stt-watson notify hypothesis to his listeners when he receive it)Hypothesis format:{    'confidence': '0.1' // confidence of the sentence or words if exist    'transcript': 'the transcription of your voice'}"""classMyListener(SttWatsonAbstractListener):def__init__(self):pass"""    This give hypothesis from watson when your sentence is finished    """deflistenHypothesis(self,hypothesis):print"Hypothesis: {0}".format(hypothesis)"""    This give the json received from watson    """deflistenPayload(self,payload):print(u"Text message received: {0}".format(payload))"""    This give hypothesis from watson when your sentence is not finished    """deflistenInterimHypothesis(self,interimHypothesis):print"Interim hypothesis: {0}".format(interimHypothesis)myListener=MyListener()sttWatson=SttWatson('watson_user','watson_password')sttWatson.addListener(myListener)sttWatson.run()

About

Continuous speech to text using watson in python with websocket and record from microphone

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python100.0%

[8]ページ先頭

©2009-2025 Movatter.jp