Created
April 2, 2020 06:05
-
-
Save AntiKnot/6d0a6fa8faabc486205def1ce51669ed to your computer and use it in GitHub Desktop.
IBM waston speach to text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from ibm_watson import SpeechToTextV1 | |
| speech_to_text = SpeechToTextV1( | |
| iam_apikey='{apikey}'.format(apikey="APIKEY"), | |
| url='{url}'.format(url="https://stream.watsonplatform.net/speech-to-text/api") | |
| ) | |
| with open('audio-file.flac', 'rb')as audio_file: | |
| print(speech_to_text.recognize( | |
| audio_file, content_type='audio/flac', timestamps=True, model='zh-CN_NarrowbandModel', word_confidence=True | |
| )) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IBM云提供的语音转文本服务。 之前一个想法是给podcast做字幕用。