Skip to content Skip to sidebar Skip to footer

Microphone Input In Html For Flask

I am developing a web app with Flask and speech recognition for audio inputs, processing and displaying an output on screen. This post has helped me organize the input of audio fil

Solution 1:

function to stream audio live using flask. Actually i didn't get what you acutually want to do. But this way you can stream audio in flask.

@app.route("/fetchAudio",methods=["GET"])deffetch_audio():
    defgenerate():
       withopen("SampleAudio.mp3", "rb") as audio: # your audio file path here
          audio_data = audio.read(1024)
       while audio_data:
            yield audio_data
            audio_data = audio.read(1024)
    return Response(generate(), mimetype="audio/x-wav") # header for audio type

I hope this'll help. github_link

Post a Comment for "Microphone Input In Html For Flask"