hackingbeauty / react-mic

Record audio from a user's microphone and display a cool visualization.
https://hackingbeauty.github.io/react-mic/
453 stars 158 forks source link

How can i upload this blob to firebase storage #125

Closed Yash2906 closed 3 years ago

Yash2906 commented 3 years ago

This NPM is working really great, as per output i got blob as response, but however i can upload it to firebase storage, i have put all firebase storage upload code , and uploading is also working fine, but after download from storage its not working, and all time upload file storage is 9B only

Yash2906 commented 3 years ago
onStop(recordedBlob) {
    console.log("recordedBlob is: ", recordedBlob);
    var storage = app.storage();
    var storageRef = storage.ref();
    var uploadTask = storageRef
    .child("folder/" + "yash.mp3")
    .put(recordedBlob,{
        contentType: 'audio/mpeg',
    });
    uploadTask.then(() => console.log("uploading"));
}
Yash2906 commented 3 years ago

fixed, need to send recordedBlob.blob ^^