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

MethodReturnsDescription
play(name)VoiceHandlePlay a sound by name
get(name)SoundDefinition | undefinedGet the raw definition
soundsstring[]List of sound names
readybooleanWhether the patch is loaded
toJSON()SoundPatchSerialize back to JSON