pnpm dlx shadcn@latest add @audio-ui/use-demo-source
import { useDemoSource } from "@/hooks/use-demo-source";| Files | hooks/use-demo-source.ts |
|---|---|
| Depends on | demo-sound, use-audio-session |
| npm | Nothing |
| Used by | block-device-chain, use-device-loop |
| Export | Kind | What it is |
|---|---|---|
useDemoSource | function | The sound a device plays: the one chosen in its session, such as from a preview's bar, else fallback, the one that shows best what the device does. |
Usage
The sound a device plays: the one chosen in its session, such as from a preview's bar, else fallback, the one that shows best what the device does. It tells the session its fallback, so a bar offers the choice only where there is one.
import { useDemoSource } from "@/hooks/use-demo-source";
const name = useDemoSource("groove"); // one of DEMO_SOURCESThe sounds are demo-sound's, made in code. Outside a session it is always fallback.