klaudio 0.11.1 → 0.11.3

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 CHANGED
@@ -1,96 +1,96 @@
1
- # klaudio
2
-
3
- Add sound effects to your [Claude Code](https://docs.anthropic.com/en/docs/claude-code) sessions. Plays sounds when Claude finishes a task, sends a notification, and more.
4
-
5
- ## Quick Start
6
-
7
- ```bash
8
- npx klaudio
9
- ```
10
-
11
- The interactive installer walks you through:
12
-
13
- 1. **Choose scope** — install globally (`~/.claude`) or per-project (`.claude/`), or launch the **Music Player**
14
- 2. **Pick a source** — use a built-in preset, OS system sounds, scan your Steam & Epic Games library, or provide custom files
15
- 3. **Preview & assign** — listen to sounds and assign them to events (tab to switch between events)
16
- 4. **Toggle voice summary** — enable TTS to hear a spoken summary when tasks complete
17
- 5. **Install** — writes Claude Code hooks to your `settings.json`
18
-
19
- ## Sound Sources
20
-
21
- ### Built-in Presets
22
-
23
- Ready-made sound packs (Retro 8-bit, Minimal Zen, Sci-Fi Terminal, Victory Fanfare) that work out of the box.
24
-
25
- ### System Sounds
26
-
27
- Use your OS built-in notification sounds (Windows Media, macOS system sounds, Linux sound themes).
28
-
29
- ### Game Sound Scanner
30
-
31
- Scans your local Steam and Epic Games libraries for audio files:
32
-
33
- - Finds loose audio files (`.wav`, `.mp3`, `.ogg`, `.flac`, `.aac`)
34
- - Extracts packed audio (Wwise `.wem`, FMOD `.bank`, `.fsb`) using [vgmstream](https://vgmstream.org/) (downloaded automatically)
35
- - Extracts Unity game audio from `.resource` files (PCM decoded directly, Vorbis converted via vgmstream)
36
- - Parses Wwise metadata (`SoundbanksInfo.json`) for descriptive filenames
37
- - Categorizes sounds (voice, ambient, music, SFX, UI, creature) for easy browsing
38
- - Caches extracted sounds in `~/.klaudio/cache/` for instant reuse
39
-
40
- ### Custom Files
41
-
42
- Point to your own `.wav`/`.mp3` files.
43
-
44
- ## Music Player
45
-
46
- Play longer game tracks (30s–10min) as background music while you code:
47
-
48
- - **Shuffle all** — scans all cached game audio, filters by duration, picks random tracks continuously
49
- - **Play songs from game** — pick a specific cached game and play its music
50
- - Controls: `n` next, `space` pause/resume, `esc` back
51
- - Background scanning — starts playing as soon as the first track is found, keeps indexing
52
-
53
- Requires previously extracted game audio (use "Scan local games" first).
54
-
55
- ## Voice Summary (TTS)
56
-
57
- When enabled, klaudio speaks a short summary of what Claude did after playing the task-complete sound. Uses [Piper](https://github.com/rhasspy/piper) for fast, offline neural text-to-speech (auto-downloaded on first use, ~40MB total).
58
-
59
- - Toggle with `t` on the scope or confirm screen
60
- - Reads the first 1–2 sentences of Claude's last message (up to ~25 words), preserving version numbers and filenames
61
- - Uses the `en_GB-alan-medium` voice (British male)
62
- - Hooks receive data via stdin from Claude Code — no extra setup needed
63
-
64
- ## Features
65
-
66
- - **Auto-preview** — sounds play automatically as you browse the list (toggle with `p`)
67
- - **Multi-game selection** — pick sounds from different games, tab between events
68
- - **Category filtering** — drill into voice, ambient, SFX, etc. when a game has enough variety
69
- - **Type-to-filter** — start typing to narrow down long lists
70
- - **Duration filter** — type `<10s`, `>5s`, `<=3s` etc. to filter by audio length
71
- - **10-second clamp** — long sounds are processed with ffmpeg: silence stripped, fade out baked in
72
- - **Background scanning** — game list updates live as directories are scanned
73
- - **Re-apply current sounds** — re-running the installer shows your current selections with a quick re-apply option
74
-
75
- ## Events
76
-
77
- | Event | Triggers when |
78
- |---|---|
79
- | Notification | Claude needs your attention |
80
- | Task Complete | Claude finishes a response |
81
-
82
- ## Uninstall
83
-
84
- ```bash
85
- npx klaudio --uninstall
86
- ```
87
-
88
- ## Requirements
89
-
90
- - Node.js 18+ (Claude Code already requires this)
91
- - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed
92
- - For packed audio extraction: internet connection (vgmstream-cli downloaded automatically)
93
- - For voice summaries: internet connection on first use (Piper TTS downloaded automatically)
94
- - For best playback with fade effects: [ffmpeg/ffplay](https://ffmpeg.org/) on PATH (falls back to native players)
95
-
96
- > **Note:** Currently only tested on Windows. macOS and Linux support is planned but not yet verified.
1
+ # klaudio
2
+
3
+ Add sound effects to your [Claude Code](https://docs.anthropic.com/en/docs/claude-code) sessions. Plays sounds when Claude finishes a task, sends a notification, and more.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ npx klaudio
9
+ ```
10
+
11
+ The interactive installer walks you through:
12
+
13
+ 1. **Choose scope** — install globally (`~/.claude`) or per-project (`.claude/`), or launch the **Music Player**
14
+ 2. **Pick a source** — use a built-in preset, OS system sounds, scan your Steam & Epic Games library, or provide custom files
15
+ 3. **Preview & assign** — listen to sounds and assign them to events (tab to switch between events)
16
+ 4. **Toggle voice summary** — enable TTS to hear a spoken summary when tasks complete
17
+ 5. **Install** — writes Claude Code hooks to your `settings.json`
18
+
19
+ ## Sound Sources
20
+
21
+ ### Built-in Presets
22
+
23
+ Ready-made sound packs (Retro 8-bit, Minimal Zen, Sci-Fi Terminal, Victory Fanfare) that work out of the box.
24
+
25
+ ### System Sounds
26
+
27
+ Use your OS built-in notification sounds (Windows Media, macOS system sounds, Linux sound themes).
28
+
29
+ ### Game Sound Scanner
30
+
31
+ Scans your local Steam and Epic Games libraries for audio files:
32
+
33
+ - Finds loose audio files (`.wav`, `.mp3`, `.ogg`, `.flac`, `.aac`)
34
+ - Extracts packed audio (Wwise `.wem`, FMOD `.bank`, `.fsb`) using [vgmstream](https://vgmstream.org/) (downloaded automatically)
35
+ - Extracts Unity game audio from `.resource` files (PCM decoded directly, Vorbis converted via vgmstream)
36
+ - Parses Wwise metadata (`SoundbanksInfo.json`) for descriptive filenames
37
+ - Categorizes sounds (voice, ambient, music, SFX, UI, creature) for easy browsing
38
+ - Caches extracted sounds in `~/.klaudio/cache/` for instant reuse
39
+
40
+ ### Custom Files
41
+
42
+ Point to your own `.wav`/`.mp3` files.
43
+
44
+ ## Music Player
45
+
46
+ Play longer game tracks (30s–10min) as background music while you code:
47
+
48
+ - **Shuffle all** — scans all cached game audio, filters by duration, picks random tracks continuously
49
+ - **Play songs from game** — pick a specific cached game and play its music
50
+ - Controls: `n` next, `space` pause/resume, `esc` back
51
+ - Background scanning — starts playing as soon as the first track is found, keeps indexing
52
+
53
+ Requires previously extracted game audio (use "Scan local games" first).
54
+
55
+ ## Voice Summary (TTS)
56
+
57
+ When enabled, klaudio speaks a short summary of what Claude did after playing the task-complete sound. Uses [Piper](https://github.com/rhasspy/piper) for fast, offline neural text-to-speech (auto-downloaded on first use, ~40MB total).
58
+
59
+ - Toggle with `t` on the scope or confirm screen
60
+ - Reads the first 1–2 sentences of Claude's last message (up to ~25 words), preserving version numbers and filenames
61
+ - Uses the `en_GB-alan-medium` voice (British male)
62
+ - Hooks receive data via stdin from Claude Code — no extra setup needed
63
+
64
+ ## Features
65
+
66
+ - **Auto-preview** — sounds play automatically as you browse the list (toggle with `p`)
67
+ - **Multi-game selection** — pick sounds from different games, tab between events
68
+ - **Category filtering** — drill into voice, ambient, SFX, etc. when a game has enough variety
69
+ - **Type-to-filter** — start typing to narrow down long lists
70
+ - **Duration filter** — type `<10s`, `>5s`, `<=3s` etc. to filter by audio length
71
+ - **10-second clamp** — long sounds are processed with ffmpeg: silence stripped, fade out baked in
72
+ - **Background scanning** — game list updates live as directories are scanned
73
+ - **Re-apply current sounds** — re-running the installer shows your current selections with a quick re-apply option
74
+
75
+ ## Events
76
+
77
+ | Event | Triggers when |
78
+ |---|---|
79
+ | Notification | Claude needs your attention |
80
+ | Task Complete | Claude finishes a response |
81
+
82
+ ## Uninstall
83
+
84
+ ```bash
85
+ npx klaudio --uninstall
86
+ ```
87
+
88
+ ## Requirements
89
+
90
+ - Node.js 18+ (Claude Code already requires this)
91
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed
92
+ - For packed audio extraction: internet connection (vgmstream-cli downloaded automatically)
93
+ - For voice summaries: internet connection on first use (Piper TTS downloaded automatically)
94
+ - For best playback with fade effects: [ffmpeg/ffplay](https://ffmpeg.org/) on PATH (falls back to native players)
95
+
96
+ > **Note:** Currently only tested on Windows. macOS and Linux support is planned but not yet verified.
package/bin/cli.js CHANGED
@@ -1,45 +1,45 @@
1
1
  #!/usr/bin/env node
2
-
3
- // Subcommand: klaudio play <file> [--tts] [--voice <voice>]
4
- if (process.argv[2] === "play") {
5
- const { handlePlayCommand } = await import("../src/player.js");
6
- await handlePlayCommand(process.argv.slice(3));
7
- process.exit(0);
8
- }
9
-
10
- // Subcommand: klaudio notify "title" "body"
11
- if (process.argv[2] === "notify") {
12
- const title = process.argv[3] || "klaudio";
13
- const body = process.argv[4] || "";
14
- if (body) {
15
- const { sendNotification } = await import("../src/notify.js");
16
- await sendNotification(title, body);
17
- }
18
- process.exit(0);
19
- }
20
-
21
- // Subcommand: klaudio say "text" [--voice <voice>]
22
- if (process.argv[2] === "say") {
23
- const args = process.argv.slice(3);
24
- const text = args.find((a) => !a.startsWith("--"));
25
- const voice = args.find((a) => a.startsWith("--voice="))?.slice(8)
26
- || args[args.indexOf("--voice") + 1];
27
- if (text) {
28
- const { speak } = await import("../src/tts.js");
29
- await speak(text, { voice });
30
- }
31
- process.exit(0);
32
- }
33
-
34
- // Default: interactive installer UI
35
- const { run } = await import("../src/cli.js");
36
-
37
- run().catch((err) => {
38
- if (err.name === "ExitPromptError") {
39
- // User pressed Ctrl+C
40
- console.log("\n Cancelled.\n");
41
- process.exit(0);
42
- }
43
- console.error(err);
44
- process.exit(1);
45
- });
2
+
3
+ // Subcommand: klaudio play <file> [--tts] [--voice <voice>]
4
+ if (process.argv[2] === "play") {
5
+ const { handlePlayCommand } = await import("../src/player.js");
6
+ await handlePlayCommand(process.argv.slice(3));
7
+ process.exit(0);
8
+ }
9
+
10
+ // Subcommand: klaudio notify "title" "body"
11
+ if (process.argv[2] === "notify") {
12
+ const title = process.argv[3] || "klaudio";
13
+ const body = process.argv[4] || "";
14
+ if (body) {
15
+ const { sendNotification } = await import("../src/notify.js");
16
+ await sendNotification(title, body);
17
+ }
18
+ process.exit(0);
19
+ }
20
+
21
+ // Subcommand: klaudio say "text" [--voice <voice>]
22
+ if (process.argv[2] === "say") {
23
+ const args = process.argv.slice(3);
24
+ const text = args.find((a) => !a.startsWith("--"));
25
+ const voice = args.find((a) => a.startsWith("--voice="))?.slice(8)
26
+ || args[args.indexOf("--voice") + 1];
27
+ if (text) {
28
+ const { speak } = await import("../src/tts.js");
29
+ await speak(text, { voice });
30
+ }
31
+ process.exit(0);
32
+ }
33
+
34
+ // Default: interactive installer UI
35
+ const { run } = await import("../src/cli.js");
36
+
37
+ run().catch((err) => {
38
+ if (err.name === "ExitPromptError") {
39
+ // User pressed Ctrl+C
40
+ console.log("\n Cancelled.\n");
41
+ process.exit(0);
42
+ }
43
+ console.error(err);
44
+ process.exit(1);
45
+ });
package/package.json CHANGED
@@ -1,44 +1,40 @@
1
- {
2
- "name": "klaudio",
3
- "version": "0.11.1",
4
- "description": "Add sound effects to your coding sessions — play sounds when tasks complete, notifications arrive, and more",
5
- "type": "module",
6
- "bin": {
7
- "klaudio": "./bin/cli.js"
8
- },
9
- "files": [
10
- "bin/",
11
- "src/",
12
- "sounds/"
13
- ],
14
- "scripts": {
15
- "generate-sounds": "node scripts/generate-sounds.js",
16
- "start": "node bin/cli.js",
17
- "build": "bun run build.js",
18
- "build:all": "bun run build.js --all"
19
- },
20
- "keywords": [
21
- "klonk",
22
- "sounds",
23
- "sfx",
24
- "hooks",
25
- "notifications",
26
- "audio",
27
- "claude-code",
28
- "coding-tools"
29
- ],
30
- "license": "MIT",
31
- "dependencies": {
32
- "ink": "^6.8.0",
33
- "ink-select-input": "^6.2.0",
34
- "ink-spinner": "^5.0.0",
35
- "react": "^19.2.4"
36
- },
37
- "engines": {
38
- "node": ">=18"
39
- },
40
- "repository": {
41
- "type": "git",
42
- "url": "https://github.com/needle-tools/klaudio.git"
43
- }
44
- }
1
+ {
2
+ "name": "klaudio",
3
+ "version": "0.11.3",
4
+ "description": "Add sound effects to your coding sessions — play sounds when tasks complete, notifications arrive, and more",
5
+ "type": "module",
6
+ "bin": {
7
+ "klaudio": "./bin/cli.js"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "src/",
12
+ "sounds/"
13
+ ],
14
+ "scripts": {
15
+ "generate-sounds": "node scripts/generate-sounds.js",
16
+ "start": "node bin/cli.js",
17
+ "build": "bun run build.js",
18
+ "build:all": "bun run build.js --all"
19
+ },
20
+ "keywords": [
21
+ "klonk",
22
+ "sounds",
23
+ "sfx",
24
+ "hooks",
25
+ "notifications",
26
+ "audio",
27
+ "claude-code",
28
+ "coding-tools"
29
+ ],
30
+ "license": "MIT",
31
+ "dependencies": {
32
+ "ink": "^6.8.0",
33
+ "ink-select-input": "^6.2.0",
34
+ "ink-spinner": "^5.0.0",
35
+ "react": "^19.2.4"
36
+ },
37
+ "engines": {
38
+ "node": ">=18"
39
+ }
40
+ }