Created
January 19, 2017 13:00
-
-
Save amit4111989/b221316d89649f520f0aa0aaa4b816ce 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 current_data/%s current_data/%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