# @web-noise/sdk

> This sdk provides functions and types for creating and managing audio patches used in web-based audio applications. These patches are typically constructed using various audio nodes and connections. The module simplifies the process of creating and config

Latest version **0.1.6** (published 2024-10-23) · 0 weekly downloads

## Install

```sh
npm install @web-noise/sdk
pnpm add @web-noise/sdk
yarn add @web-noise/sdk
bun add @web-noise/sdk
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2024-10-23 |
| First published | 2023-10-30 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | nogizhopaboroda |

## Links

- npm: https://www.npmjs.com/package/@web-noise/sdk
- npm.io page: https://npm.io/package/@web-noise/sdk

## Recent versions

- 0.1.6 (latest) — 2024-10-23
- 0.1.5 — 2024-08-13
- 0.1.4 — 2024-08-09
- 0.1.3 — 2024-07-31
- 0.1.2 — 2024-07-03
- 0.1.1 — 2024-07-02
- 0.1.0 — 2024-07-01
- 0.0.1 — 2023-10-30

## README

# Web Noise SDK Documentation

This sdk provides functions and types for creating and managing audio patches used in web-based audio applications. These patches are typically constructed using various audio nodes and connections. The module simplifies the process of creating and configuring these patches, making it easier to work with web audio.

## Exports <a name="exports"></a>

### `createPatchNode` <a name="createpatchnode"></a>

This function creates a patch audio node based on the provided data, which includes an array of audio nodes and edges for connections..

- **Parameters:**
  - `data` (Type: `CreatePatchNodeProps`): An object containing an array of audio nodes and edges for connections.
  - `audioContext` (Type: `AudioContext`, Optional): An optional parameter to specify an existing AudioContext. If not provided, a new AudioContext is created.

- **Returns:**
  - `PatchNode` (Type: `PatchNode`): An object containing inputs, outputs, and audio nodes for the created patch node.

## Interfaces <a name="interfaces"></a>

### `CreatePatchNodeProps` <a name="createpatchnodeprops"></a>

This interface represents the properties required for creating a patch node.

- `data` (Type: `{ nodes: WNNode[]; edges: WNEdge[] }`): An object containing an array of audio nodes and an array of edges for audio connections.
- `audioContext` (Type: `AudioContext`, Optional): An optional parameter to specify an existing AudioContext. If not provided, a new AudioContext is created.

### `PatchNode` <a name="patchnode"></a>

This interface represents the structure of a patch node, including its inputs, outputs, and audio nodes.

- `inputs` (Type: `Record<string, AudioWorkletNode>`): A record of input labels mapped to corresponding AudioWorkletNode input ports.
- `outputs` (Type: `Record<string, AudioWorkletNode>`): A record of output labels mapped to corresponding AudioWorkletNode output ports.
- `audioNodes` (Type: `Patch["audioNodes"]`): The audio nodes associated with the patch node.

---
_Source: https://npm.io/package/@web-noise/sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
