@tritard/waterbrother 0.14.21 → 0.14.22

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/voice.js +14 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tritard/waterbrother",
3
- "version": "0.14.21",
3
+ "version": "0.14.22",
4
4
  "description": "Waterbrother: Grok-powered coding CLI with local tools, sessions, operator modes, and approval controls",
5
5
  "type": "module",
6
6
  "bin": {
package/src/voice.js CHANGED
@@ -714,14 +714,20 @@ export async function setupVoice(onStatus) {
714
714
  playArgs = [mp3Path];
715
715
  } else if (process.platform === "win32") {
716
716
  // Use sox to play the audio — it's already installed for recording
717
- if (soxPath) {
718
- playCmd = soxPath;
719
- playArgs = [mp3Path, "-d"];
720
- } else {
721
- // Fallback: PowerShell Start-Process to open in default player
722
- playCmd = "powershell.exe";
723
- playArgs = ["-NoProfile", "-Command", `Start-Process "${mp3Path}" -Wait`];
724
- }
717
+ // Use PowerShell to play MP3 via Windows Media Player COM
718
+ const psScript = `
719
+ $wmp = New-Object -ComObject WMPlayer.OCX
720
+ $wmp.URL = "${mp3Path.replace(/\\/g, "\\\\")}"
721
+ $wmp.controls.play()
722
+ Start-Sleep -Milliseconds 500
723
+ while($wmp.playState -eq 3){ Start-Sleep -Milliseconds 200 }
724
+ $wmp.close()
725
+ `.trim();
726
+ const psPath = path.join(tmpDir, `tts-${ts}.ps1`);
727
+ await fs.writeFile(psPath, psScript);
728
+ cleanupFiles.push(psPath);
729
+ playCmd = "powershell.exe";
730
+ playArgs = ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", psPath];
725
731
  } else {
726
732
  playCmd = "mpv";
727
733
  playArgs = ["--no-video", "--really-quiet", mp3Path];