J.g
J.g

Reputation: 41

Creating a wav file from a blob

I'm using the audio-react-recorder library to record audio from a user that want to eventually send to my back-end (as a wav-file). The react-recorder is generating a blob ({blob: Blob, url: 'blob:http://localhost:3000/c572ac68-6b7c-4992-b134-947df05ef32b', type: 'audio/wav'}) but I am unsure on how to convert it to a .wav file to be sent to the back-end. What I've tried so far:

let f = new File([audio], 'test.wav', { lastModified: new Date().getTime(), type: audio.type });

which causes an error when I try to pass to the API (wit.ai) I'm using. Also when I try to download this file, it is unplayable so I assume I'm not creating the file properly. Any ideas how to properly create the .wav file from the blob?

Upvotes: 0

Views: 1642

Answers (0)

Related Questions