Introduction
This React audio library provides a simple and deconstructive way to work with audio in React applications.
Installation
undefined
npm install @clxrity/react-audio
Example structure with Next.js
- page.tsx
- layout.tsx
- globals.css
- drums_2.wav
/* app/globals.css */
@import "@clxrity/react-audio/index.css";
/**
* Import the main CSS file for the React Audio library.
* This will apply the default styles to the components.
*/
/* app/page.tsx */
"use client"; // All react-audio components must be used in a client component
import { Waveform } from "@clxrity/react-audio";
export default function Page() {
return (
<div>
<h1>Welcome to React Audio</h1>
<Waveform src="/audio/drums_2.wav" />
</div>
);
}
Last updated on