loadPatch
import { loadPatch } from "@web-kits/audio";
const patch = await loadPatch("/patches/minimal.json");
const voice = patch.play("tap");Parameters:
source: string | SoundPatch- URL to a JSON file, or an inline patch object
Returns: Promise<AudioPatch>
Patch instance
| Method | Returns | Description |
|---|---|---|
play(name) | VoiceHandle | Play a sound by name |
get(name) | SoundDefinition | undefined | Get the raw definition |
sounds | string[] | List of sound names |
ready | boolean | Whether the patch is loaded |
toJSON() | SoundPatch | Serialize back to JSON |