Basically, I have set an application with the MediaDevices.getUserMedia WebRTC API. I have recorded the audios and all, all is good in theory. But I got to retrieve the audio now to listen to them.
I wonder now how to download audio Post in my MongoDB database. I have tried to export my MongoDB database but I receive only JSON or CSV file, not my audios files.
I have heard about gridFS but only in image-handling context. Before dive deeply into gridFS I would get your thinks about audio retrieving with Mlab. and MongoDB more widely. Also, gridFS seems to be designed for large files, but in my case, I just want to store ridiculously little files of some hundreds of bytes, so gridFS seems maybe overkilled? Maybe there is a more efficient solution?
EDIT : I struggle to translate my data in order to store it in my database.
So far, my console return me :
XML Parsing Error: syntax error
Here my App.js :
// post section
async handleSubmit(e){
e.preventDefault();
Axios.post("/api/words",{
"sound":this.state.blob
})
//.then((res) => res.json())
.then((data) => console.log(data))
//pass submitted value to true in order to declench allDelete function
}
(...)
// blob formatting section :
saveAudio() {
// convert saved chunks to blob
const blob = new Blob(this.chunks, {type: audioType});
this.setState({blob : blob})
Thanks.