I would like to embed an audio recording feature in my dash app. If the user clicks a ‘RECORD’ button, the app should record the audio until a ‘STOP’ button is clicked and then I would like to process that audio file in the backend. Is that possible? I searched everywhere and I don’t find a relevant solution to my problem.
I couldn’t find an answer to the question myself, so I had to create one myself.
create recorder.js file inside the assets directory
your_project
app.py
assets/recorder.js
You will need to add two buttons to your application with ids start-button and stop-button, feel free to name it something different. Change the names in javascript as well then.
In case this helps anyone else, I have abstracted the audio recording work I’ve needed for projects in dash-recording-components · PyPI. It’s very basic and I need to add some more documentation, but I’m hoping this will help out the community. Also, props to @ed-the-great , this work is also excellent.