claude-code-notify-lite 1.0.4 → 1.0.5
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/package.json +1 -1
- package/src/audio.js +14 -11
package/package.json
CHANGED
package/src/audio.js
CHANGED
|
@@ -50,17 +50,20 @@ function playWithAfplay(soundPath, volume) {
|
|
|
50
50
|
function playWithPowershell(soundPath) {
|
|
51
51
|
return new Promise((resolve) => {
|
|
52
52
|
logger.info('Playing sound with PowerShell', { soundPath });
|
|
53
|
-
|
|
54
|
-
const psScript =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
|
|
54
|
+
const psScript = `
|
|
55
|
+
Add-Type -AssemblyName PresentationCore
|
|
56
|
+
$player = New-Object System.Windows.Media.MediaPlayer
|
|
57
|
+
$player.Open([System.Uri]'${soundPath.replace(/'/g, "''")}')
|
|
58
|
+
Start-Sleep -Milliseconds 300
|
|
59
|
+
$player.Play()
|
|
60
|
+
Start-Sleep -Seconds 3
|
|
61
|
+
$player.Close()
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
const base64Command = Buffer.from(psScript, 'utf16le').toString('base64');
|
|
65
|
+
|
|
66
|
+
exec(`powershell -NoProfile -ExecutionPolicy Bypass -EncodedCommand ${base64Command}`,
|
|
64
67
|
{ encoding: 'utf8', windowsHide: true },
|
|
65
68
|
(err) => {
|
|
66
69
|
if (err) {
|