@ai-rpg-engine/soundpack-core 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -0
- package/dist/registry.test.d.ts +2 -0
- package/dist/registry.test.d.ts.map +1 -0
- package/dist/registry.test.js +49 -0
- package/dist/registry.test.js.map +1 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/ai-rpg-engine/readme.png" width="300" alt="AI RPG Engine">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/@ai-rpg-engine/soundpack-core"><img src="https://img.shields.io/npm/v/@ai-rpg-engine/soundpack-core.svg" alt="npm"></a>
|
|
7
|
+
<a href="https://github.com/mcp-tool-shop-org/ai-rpg-engine/actions/workflows/ci.yml"><img src="https://github.com/mcp-tool-shop-org/ai-rpg-engine/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
8
|
+
<a href="https://github.com/mcp-tool-shop-org/ai-rpg-engine/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
# @ai-rpg-engine/soundpack-core
|
|
12
|
+
|
|
13
|
+
Content-addressable sound registry and pack specification for the [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine).
|
|
14
|
+
|
|
15
|
+
Part of the **Immersion Runtime** — manages audio assets as tagged, queryable collections.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @ai-rpg-engine/soundpack-core
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## What It Does
|
|
24
|
+
|
|
25
|
+
Sound packs are loadable collections of audio entries (SFX, ambient loops, music, voice) with rich metadata for discovery. The registry supports tag-based queries, intensity filtering, and mood matching.
|
|
26
|
+
|
|
27
|
+
Ships with a **core sound pack** that maps to [voice-soundboard](https://github.com/mcp-tool-shop-org/original_voice-soundboard) procedural effects.
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { SoundRegistry, CORE_SOUND_PACK } from '@ai-rpg-engine/soundpack-core';
|
|
33
|
+
|
|
34
|
+
const registry = new SoundRegistry();
|
|
35
|
+
registry.load(CORE_SOUND_PACK);
|
|
36
|
+
|
|
37
|
+
// Query by domain
|
|
38
|
+
const ambient = registry.query({ domain: 'ambient' });
|
|
39
|
+
|
|
40
|
+
// Query by tags + mood
|
|
41
|
+
const tenseSfx = registry.query({ tags: ['alert'], mood: ['dread'] });
|
|
42
|
+
|
|
43
|
+
// Get specific entry
|
|
44
|
+
const entry = registry.get('ui_success');
|
|
45
|
+
console.log(entry?.voiceSoundboardEffect); // "chime_success"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Core Sound Pack
|
|
49
|
+
|
|
50
|
+
13 entries mapped to voice-soundboard procedural effects:
|
|
51
|
+
|
|
52
|
+
| ID | Effect | Domain | Tags |
|
|
53
|
+
|----|--------|--------|------|
|
|
54
|
+
| `ui_notification` | `chime_notification` | sfx | ui, alert |
|
|
55
|
+
| `ui_success` | `chime_success` | sfx | ui, positive |
|
|
56
|
+
| `ui_error` | `chime_error` | sfx | ui, negative |
|
|
57
|
+
| `ui_click` | `click` | sfx | ui, input |
|
|
58
|
+
| `ui_pop` | `pop` | sfx | ui, light |
|
|
59
|
+
| `ui_whoosh` | `whoosh` | sfx | ui, transition |
|
|
60
|
+
| `alert_warning` | `warning` | sfx | alert, caution |
|
|
61
|
+
| `alert_critical` | `critical` | sfx | alert, danger |
|
|
62
|
+
| `alert_info` | `info` | sfx | alert, info |
|
|
63
|
+
| `ambient_rain` | `rain` | ambient | weather, calm |
|
|
64
|
+
| `ambient_white_noise` | `white_noise` | ambient | background |
|
|
65
|
+
| `ambient_drone` | `drone` | ambient | dark, tension |
|
|
66
|
+
|
|
67
|
+
## Custom Sound Packs
|
|
68
|
+
|
|
69
|
+
Create your own sound pack by providing a `SoundPackManifest`:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import type { SoundPackManifest } from '@ai-rpg-engine/soundpack-core';
|
|
73
|
+
|
|
74
|
+
const myPack: SoundPackManifest = {
|
|
75
|
+
name: 'medieval-tavern',
|
|
76
|
+
version: '1.0.0',
|
|
77
|
+
description: 'Tavern ambience and interaction sounds',
|
|
78
|
+
author: 'your-name',
|
|
79
|
+
entries: [
|
|
80
|
+
{
|
|
81
|
+
id: 'tavern_chatter',
|
|
82
|
+
tags: ['ambient', 'social'],
|
|
83
|
+
domain: 'ambient',
|
|
84
|
+
intensity: 'low',
|
|
85
|
+
mood: ['calm', 'social'],
|
|
86
|
+
durationClass: 'long-loop',
|
|
87
|
+
cooldownMs: 0,
|
|
88
|
+
variants: ['tavern_chatter_01.wav'],
|
|
89
|
+
source: 'file',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
registry.load(myPack);
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Part of AI RPG Engine
|
|
98
|
+
|
|
99
|
+
This package is part of the [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine) monorepo. See the root README for the full architecture.
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.test.d.ts","sourceRoot":"","sources":["../src/registry.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { SoundRegistry } from './registry.js';
|
|
3
|
+
import { CORE_SOUND_PACK } from './core-pack.js';
|
|
4
|
+
describe('SoundRegistry', () => {
|
|
5
|
+
it('should load the core sound pack', () => {
|
|
6
|
+
const registry = new SoundRegistry();
|
|
7
|
+
registry.load(CORE_SOUND_PACK);
|
|
8
|
+
expect(registry.size).toBe(CORE_SOUND_PACK.entries.length);
|
|
9
|
+
});
|
|
10
|
+
it('should get an entry by ID', () => {
|
|
11
|
+
const registry = new SoundRegistry();
|
|
12
|
+
registry.load(CORE_SOUND_PACK);
|
|
13
|
+
const entry = registry.get('ui_success');
|
|
14
|
+
expect(entry).toBeDefined();
|
|
15
|
+
expect(entry.voiceSoundboardEffect).toBe('chime_success');
|
|
16
|
+
});
|
|
17
|
+
it('should query by domain', () => {
|
|
18
|
+
const registry = new SoundRegistry();
|
|
19
|
+
registry.load(CORE_SOUND_PACK);
|
|
20
|
+
const ambient = registry.query({ domain: 'ambient' });
|
|
21
|
+
expect(ambient.length).toBeGreaterThan(0);
|
|
22
|
+
expect(ambient.every((e) => e.domain === 'ambient')).toBe(true);
|
|
23
|
+
});
|
|
24
|
+
it('should query by tags', () => {
|
|
25
|
+
const registry = new SoundRegistry();
|
|
26
|
+
registry.load(CORE_SOUND_PACK);
|
|
27
|
+
const alerts = registry.query({ tags: ['alert'] });
|
|
28
|
+
expect(alerts.length).toBeGreaterThan(0);
|
|
29
|
+
});
|
|
30
|
+
it('should query by mood', () => {
|
|
31
|
+
const registry = new SoundRegistry();
|
|
32
|
+
registry.load(CORE_SOUND_PACK);
|
|
33
|
+
const tense = registry.query({ mood: ['dread'] });
|
|
34
|
+
expect(tense.length).toBeGreaterThan(0);
|
|
35
|
+
});
|
|
36
|
+
it('should return undefined for missing ID', () => {
|
|
37
|
+
const registry = new SoundRegistry();
|
|
38
|
+
registry.load(CORE_SOUND_PACK);
|
|
39
|
+
expect(registry.get('nonexistent')).toBeUndefined();
|
|
40
|
+
});
|
|
41
|
+
it('should list all IDs', () => {
|
|
42
|
+
const registry = new SoundRegistry();
|
|
43
|
+
registry.load(CORE_SOUND_PACK);
|
|
44
|
+
const ids = registry.getIds();
|
|
45
|
+
expect(ids).toContain('ui_success');
|
|
46
|
+
expect(ids).toContain('ambient_drone');
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=registry.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.test.js","sourceRoot":"","sources":["../src/registry.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC/B,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC/B,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5B,MAAM,CAAC,KAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAChC,MAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,eAAe,CA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