ai-eks / OpenClubhouse

A third-part web application based on flask to play Clubhouse audio.
https://opench.aix.uy
MIT License
1.08k stars 260 forks source link

play local audio using flask #15

Closed DolphinRidz closed 3 years ago

DolphinRidz commented 3 years ago

https://github.com/TheCodex-Me/Projects/blob/master/Speech-Recognition-Python-Final/app.py what do I do if I want to play the same selected file? please reply asap. Kind of stuck here

code below: @app.route("/", methods=["GET", "POST"]) def index(): prediction="" if request.method == "POST": print("FORM DATA RECEIVED") if "file" not in request.files: return redirect(request.url) file = request.files["file"] if file.filename == "": return redirect(request.url) if file: new_feature = extract_feature(file, mfcc=True, chroma=True, mel=True) prediction = model.predict([new_feature]) return render_template('index.html', prediction_text=prediction)

ai-eks commented 3 years ago

If you would like to play audio on your compute, you should seek other python package. If you want to play audio on web, you should use JS API to play it.

Close this issue, because it has nothing to do with this repo.