audiora
v1.1.0
Published
Picture-driven synthesis for the web — maps color and light into pitch, timing, and texture.
Maintainers
Readme
How to install
npm install audioraUsage
Minimal HTML shell for live playback (two canvases + a play gesture):
<canvas id="map_canvas" width="640" height="360"></canvas>
<canvas id="wave_canvas" width="640" height="80"></canvas>
<button id="play">Play</button>
<script type="module">
import { Audiora, PRESETS } from "audiora";
const audiora = new Audiora({
waveCanvas: document.getElementById("wave_canvas"),
mapCanvas: document.getElementById("map_canvas"),
});
await audiora.loadImage("/photo.jpg");
audiora.applyParams(PRESETS.Haze, { tween: false });
audiora.addEventListener("start", () => {
document.getElementById("play").textContent = "Stop";
});
audiora.addEventListener("error", (e) => {
console.error(e.detail.context, e.detail.error);
});
document.getElementById("play").onclick = () => audiora.play();
// offline WAV — no play() needed; renders via OfflineAudioContext
const blob = await audiora.toBlob({ params: PRESETS.Bite, duration: 12 });
</script>See the API reference for constructors, params, presets, scan modes, and TypeScript types.
