Turn AudioBuffers into AudioData in a chunked fashion

This commit is contained in:
Vanilagy
2025-01-02 19:28:43 +01:00
parent 0f25dcb096
commit 022b157eeb
5 changed files with 53 additions and 25 deletions
+3 -1
View File
@@ -40,6 +40,7 @@
format = new Metamuxer.Mp4OutputFormat({ fastStart: false }); // new Metamuxer.MkvOutputFormat();// new Metamuxer.Mp4OutputFormat({ fastStart: false });
let target = new Metamuxer.ArrayBufferTarget();
/*
target = new Metamuxer.StreamTarget(new WritableStream({
async write(chunk) {
console.log(chunk)
@@ -47,6 +48,7 @@
await new Promise(resolve => setTimeout(resolve, 250));
}
}), { chunked: true });
*/
let output = new Metamuxer.Output({ format, target });
@@ -170,5 +172,5 @@ Testing... <00:17.350>One... <00:18.125>Two...
await output.finalize();
console.log(target);
//download(new Blob([target.buffer]), 'test.mp4');
download(new Blob([target.buffer]), 'test.mp4');
</script>