As for JS audioCtx.createBuffer to convert to Blob?

There is such code:
let source = audioCtx.createBufferSource();
source.buffer = myArrayBuffer;

Which successfully plays on the page. Need this audio download from the page, but have no idea how it converti in the Blob. Tried to convert to wave, but somewhere is a mistake made, not envelope.
Are there easier ways to download audio?

If convert to wav, then here is a good piece of code:
But then how to convert this wav to a Blob?
I tried this:
// Wav -> blob
function getBlobFromWav(wav) {
 let srclist = [];
 let count = wav.byteLength;
 for (let i = 0; i < count; i++) {
 return new Blob(srclist, { type: 'audio/wav' });

But I have page krasitsja even at 4-second file.
April 4th 20 at 00:52
1 answer
April 4th 20 at 00:54
The implementation is created from the example AudioBuffer and your Converter to WAV

Find more questions by tags JavaScript