Skip to content

Commit 6f976ea

Browse files
authored
Add TTS support for Windows (#15)
* add TTS support for windows * lint
1 parent de6f27c commit 6f976ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tts/tts_windows.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package tts
22

33
import (
4+
"fmt"
45
"os/exec"
56
)
67

78
func TtsCommand(message string) *exec.Cmd {
8-
return exec.Command("echo", message)
9+
speakCmd := fmt.Sprintf("(New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('%s');", message)
10+
return exec.Command("PowerShell", "-Command", "Add-Type", "-AssemblyName", "System.Speech;", speakCmd)
911
}

0 commit comments

Comments
 (0)