Skip to content

Instantly share code, notes, and snippets.

@AntiKnot
Created April 2, 2020 06:05
Show Gist options
  • Select an option

  • Save AntiKnot/6d0a6fa8faabc486205def1ce51669ed to your computer and use it in GitHub Desktop.

Select an option

Save AntiKnot/6d0a6fa8faabc486205def1ce51669ed to your computer and use it in GitHub Desktop.
IBM waston speach to text
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
))
@AntiKnot
Copy link
Copy Markdown
Author

AntiKnot commented Apr 2, 2020

IBM云提供的语音转文本服务。 之前一个想法是给podcast做字幕用。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment