vibe-notify 0.2.0 → 0.2.2

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.ja.md CHANGED
@@ -103,10 +103,17 @@ vibe-notify [options] [sound-name]
103
103
 
104
104
  - **ランタイム依存ゼロ** — すべてのサウンド生成は純粋な Node.js で行います
105
105
  - 内蔵サウンドは WAV オーディオとしてメモリ上で生成(エンベロープ付き正弦波)
106
- - 再生にはネイティブシステムプレイヤーを使用:PowerShell SoundPlayer (Windows)、afplay (macOS)、paplay/aplay (Linux)
107
- - WAV 再生に失敗した場合は `[System.Console]::Beep()` または端末ベルにフォールバック
108
106
  - 一時ファイルは再生後すぐにクリーンアップ
109
107
 
108
+ ### ファイルフォーマット対応
109
+
110
+ | フォーマット | Windows | macOS | Linux |
111
+ |--------|---------|-------|-------|
112
+ | `.wav` | ✅ ネイティブ | ✅ ネイティブ | ✅ ネイティブ |
113
+ | `.mp3` / その他 | ✅ ffplay¹ | ✅ ネイティブ | ✅ ffplay¹ |
114
+
115
+ ¹ ffmpeg をインストール: `winget install ffmpeg` (Windows) / `sudo apt install ffmpeg` (Linux)
116
+
110
117
  ## ライセンス
111
118
 
112
119
  MIT
package/README.md CHANGED
@@ -91,7 +91,7 @@ Replace `"npx", "-y", "vibe-notify"` with `"vibe-notify"` if installed globally.
91
91
  ## CLI Reference
92
92
 
93
93
  ```
94
- vibe-notify [options] [sound-name]
94
+ vibe-notify [options] [sound-name | file-path]
95
95
 
96
96
  Options:
97
97
  --help, -h Show help
@@ -99,16 +99,26 @@ Options:
99
99
  --config, -c Print config file path
100
100
  --init Create default config file
101
101
  --version, -v Show version
102
+
103
+ You can also pass a path to a .wav/.mp3 file directly:
104
+ vibe-notify "C:\my-sounds\alert.wav"
102
105
  ```
103
106
 
104
107
  ## How It Works
105
108
 
106
109
  - **Zero runtime dependencies** — all sound generation is pure Node.js
107
110
  - Built-in sounds are generated as WAV audio in-memory (sine waves with envelope)
108
- - Playback uses native system players: PowerShell SoundPlayer (Windows), afplay (macOS), paplay/aplay (Linux)
109
- - Falls back to `[System.Console]::Beep()` or terminal bell if WAV playback fails
110
111
  - Temp files are cleaned up immediately after playback
111
112
 
113
+ ### File Format Support
114
+
115
+ | Format | Windows | macOS | Linux |
116
+ |--------|---------|-------|-------|
117
+ | `.wav` | ✅ Native | ✅ Native | ✅ Native |
118
+ | `.mp3` / other | ✅ ffplay¹ | ✅ Native | ✅ ffplay¹ |
119
+
120
+ ¹ Install ffmpeg: `winget install ffmpeg` (Windows) / `sudo apt install ffmpeg` (Linux)
121
+
112
122
  ## License
113
123
 
114
124
  MIT
package/README.zh-CN.md CHANGED
@@ -103,10 +103,17 @@ vibe-notify [options] [sound-name]
103
103
 
104
104
  - **零运行时依赖** — 所有音频均使用纯 Node.js 生成
105
105
  - 内置音效以 WAV 格式在内存中生成(带包络的正弦波)
106
- - 播放使用系统原生播放器:PowerShell SoundPlayer (Windows)、afplay (macOS)、paplay/aplay (Linux)
107
- - 如果 WAV 播放失败,回退到 `[System.Console]::Beep()` 或终端响铃
108
106
  - 临时文件在播放后立即清理
109
107
 
108
+ ### 文件格式支持
109
+
110
+ | 格式 | Windows | macOS | Linux |
111
+ |--------|---------|-------|-------|
112
+ | `.wav` | ✅ 原生 | ✅ 原生 | ✅ 原生 |
113
+ | `.mp3` / 其他 | ✅ ffplay¹ | ✅ 原生 | ✅ ffplay¹ |
114
+
115
+ ¹ 安装 ffmpeg:`winget install ffmpeg` (Windows) / `sudo apt install ffmpeg` (Linux)
116
+
110
117
  ## 许可证
111
118
 
112
119
  MIT
package/dist/index.js CHANGED
@@ -42,6 +42,17 @@ async function main() {
42
42
  // ── Play sound ───────────────────────────────────────────────────────
43
43
  const config = (0, config_1.loadConfig)();
44
44
  const soundName = cli.soundName || config.sound;
45
+ // If the argument is a path to an existing file, play it directly
46
+ if (soundName && (0, fs_1.existsSync)(soundName)) {
47
+ try {
48
+ await (0, player_1.playFile)(soundName, config.playback.method);
49
+ }
50
+ catch (err) {
51
+ console.error(`Failed to play file: ${err.message}`);
52
+ process.exit(1);
53
+ }
54
+ return;
55
+ }
45
56
  // Validate sound name
46
57
  if (soundName !== 'custom' && !(0, beep_1.getPatternByName)(soundName)) {
47
58
  console.error(`Unknown sound: "${soundName}"`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-notify",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Notification sounds for Claude Code completions — customizable beeps when your session finishes",
5
5
  "keywords": ["claude", "claude-code", "notification", "sound", "beep", "alert"],
6
6
  "license": "MIT",
Binary file
Binary file