Creating a .wav file in JS - "Not a WAVE file - no RIFF header"

1k views Asked by At

I'm trying to record audio from the browser's microphone, and save it as a .wav file (to be sent to an API)

I've got the binary blocks of what I'm after, and I can convert it to a .wav file that plays in VLC (and also in the browser)

let blob = new Blob(chunks, { type: 'audio/wav' });

But when I try to send it to the http://www.beyondverbal.com/api/, I receive

{"readyState":4,"responseText":"{\"status\":\"failure\",\"reason\":\"Not a WAVE file - no RIFF header\"}","status":400,"statusText":"Bad Request"}

Essentially the question is, how can I add the RIFF header I need, or am I going about this completely all wrong?

Thanks

0

There are 0 answers