As for JS audioCtx.createBuffer to convert to Blob?

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

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: https://github.com/Jam3/audiobuffer-to-wav/blob/ma...
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++) {
srclist.push(wav[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
Solution
https://projectsoft.ru/audio_0001.html
The implementation is created from the example AudioBuffer and your Converter to WAV

Find more questions by tags JavaScript