mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-04 01:28:45 -04:00
script for rendering wasm to raw audio file
This commit is contained in:
parent
03b79dbbde
commit
6078239821
8
renderwasm.mjs
Normal file
8
renderwasm.mjs
Normal file
@ -0,0 +1,8 @@
|
||||
import { readFile, writeFile } from 'fs/promises';
|
||||
|
||||
const wasm = (await readFile('./temp_song_file.wasm'));
|
||||
|
||||
const mod = await WebAssembly.instantiate(wasm, {});
|
||||
mod.instance.exports.render();
|
||||
const mem = mod.instance.exports.m;
|
||||
await writeFile('temp_song_file.raw', new Uint8Array(mem.buffer,mod.instance.exports.s,mod.instance.exports.l));
|
@ -882,6 +882,8 @@
|
||||
|
||||
{{- if .RenderOnStart }}
|
||||
(start $render) ;; we run render automagically when the module is instantiated
|
||||
{{- else}}
|
||||
(export "render" (func $render))
|
||||
{{- end}}
|
||||
|
||||
(func $render (param)
|
||||
|
Loading…
x
Reference in New Issue
Block a user