Flask Audio File to Wave Object Python Flask Audio File to Wave Object Python flask flask

Flask Audio File to Wave Object Python


You can try the following modification of your code:

audio = request.files['audio_file']

The request.files is a dictionary. The dictionary key that will allow you to retrieve the audio file is 'audio_file' instead of 'audio'.


you can use save() function

  audio = request.files["audio"]    path='./videos/sample.wav';    audio.save(path)

check for further detailshttps://werkzeug.palletsprojects.com/en/2.0.x/datastructures/#werkzeug.datastructures.FileStorage.save