Open DolphinRidz opened 3 years ago
I can choose the audio and predict but i want to play the audio in same page. Please reply asap.
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)
I can choose the audio and predict but i want to play the audio in same page. Please reply asap.
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)