Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement