Skip to content

play local audio using flask. #166

Open
@DolphinRidz

Description

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions