Last active
January 19, 2017 13:57
-
-
Save amit4111989/7db05c326c1010cd21bbea7e8bf07144 to your computer and use it in GitHub Desktop.
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
| @app.route('/recording', methods=['POST']) | |
| def alexa_task(): | |
| file = request.files['file'] | |
| filename = str(file.filename) | |
| file.save('current_data/' + file.filename) | |
| reply = {'msg': 'Success'} | |
| sox_command = 'sox -r 16000 -e unsigned -b 16 -c 1 %s %s.wav' % ( | |
| filename, filename[:-4]) | |
| os.system(sox_command) | |
| with open('current_file.text', 'w+') as f: | |
| f.write(str(filename[:-4])) | |
| return jsonify({'reply': reply}), 201 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment