ms speech from command line

前端 未结 7 1799
遥遥无期
遥遥无期 2020-12-02 11:23

Is there a way to use the MS Speech utility from command line? I can do it on a mac, but can\'t find any reference to it on Windows XP.

7条回答
  •  长情又很酷
    2020-12-02 11:56

    There is a powershell way also:

    Create a file called speak.ps1

    param([string]$inputText)
    Add-Type –AssemblyName System.Speech 
    $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
    $synth.Speak($inputText);
    

    Then you can call it

    .\speak.ps1 "I'm sorry Dave, I'm afraid I can't do that"
    

提交回复
热议问题