Any js framework
Any css framework
This is a simple wrapper for the Web Audio API, allowing you to easily animate your site with sound from any source.
pnpm install css-audio
or
npm install css-audio
import cssAudio from "../src";
document.addEventListener("DOMContentLoaded", async () => {
const start = await cssAudio({
src: "/elevator.wav",
});
function play() {
start();
document.removeEventListener("click", play);
}
document.addEventListener("click", play);
});
.bar {
display: block;
height: calc(var(--freq-low) / 200 * 1px);
width: 100px;
background-color: red;
}
<div class="bar"></div>
var(--freq-low)
var(--freq-mid)
var(--freq-high)
var(--track-time)
var(--track-duration)