Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import requests
  2. import json
  3. from os import path
  4.  
  5. AUDIO = path.join(path.dirname(path.realpath(__file__)),"audio-file.flac")
  6.  
  7.  
  8. parameters = {"user": "apikey:{A9Y7YKtmlxjSTWtvCVUm4KQA2WxRaz0wuSZ8jdYyZvQ1}", "header":"Content-Type: flac","data-binary": AUDIO}
  9.  
  10. response = requests.post("https://stream.watsonplatform.net/speech-to-text/api",params = parameters)
  11.  
  12. data = response.json()
  13.  
  14. print(data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement