save_audios / audio_save.py
tttarun's picture
Update audio_save.py
7a36db4 verified
raw
history blame
501 Bytes
# Server-side code to handle the audio file saving
from flask import Flask, request
app = Flask(__name__)
@app.route('/save_audio', methods=['POST'])
def save_audio():
print("Received Audio !!!!!")
audio = request.files['audio'] # Get the audio file
path = request.form['path'] # Get the path to save the audio
# Save the audio to the specified path
audio.save(path)
return "Audio saved successfully"
if __name__ == '__main__':
app.run(host='0.0.0.0',port=7860)