Skip to content

Instantly share code, notes, and snippets.

@amit4111989
Last active January 19, 2017 13:56
Show Gist options
  • Save amit4111989/7a810bf6450cbd281d3d0ca74cf05cd1 to your computer and use it in GitHub Desktop.
Save amit4111989/7a810bf6450cbd281d3d0ca74cf05cd1 to your computer and use it in GitHub Desktop.
with open(tmp_path + 'recording.wav') as inf:
files = [
('file', ('request', json.dumps(data), 'application/json; charset=UTF-8')),
('file', ('audio', inf, 'audio/L16; rate=16000; channels=1'))
]
resp = requests.post(url, headers=headers, files=files)
resp_copy = requests.post('http://speech-analysis-server-ip-address/recording', files=[files[1]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment