Skip to content

Instantly share code, notes, and snippets.

@sieroshtan
Created July 28, 2015 13:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sieroshtan/67e0c9d21c396aad642e to your computer and use it in GitHub Desktop.
Save sieroshtan/67e0c9d21c396aad642e to your computer and use it in GitHub Desktop.
Simple example using Speech To Text API of IBM's Bluemix platform in python
# https://console.ng.bluemix.net/catalog/speech-to-text/
# pip requests module required
import requests
url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize'
username = '<username>'
password = '<password>'
headers={'Content-Type': 'audio/wav'}
audio = open('./sheet.wav', 'rb')
r = requests.post(url, data=audio, headers=headers, auth=(username, password))
print(r.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment