ms speech from command line

MasterZ picture MasterZ · Jun 24, 2009 · Viewed 62.6k times · Source

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.

Answer

BananaAcid picture BananaAcid · Sep 22, 2016

My 2 cents on the topic, command line one-liners:

  • on Win using PowerShell.exe

    PowerShell -Command "Add-Type –AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('hello');"
    
  • on Win using mshta.exe

    mshta vbscript:Execute("CreateObject(""SAPI.SpVoice"").Speak(""Hello"")(window.close)")
    
  • on OSX using say

    say "hello"
    
  • Ubuntu Desktop (>=2015) using native spd-say

    spd-say "hello"
    
  • on any other Linux

  • on Raspberry Pi, Win, OSX using Node-Red

    npm i node-red-contrib-sysmessage