Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ms speech from command line

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.

like image 647
JLZenor Avatar asked Jun 24 '09 20:06

JLZenor


People also ask

How do I open dialog box in CMD?

Use a Keyboard Shortcut To quickly access the Run command dialog box, simply press the Windows key + R.

How do I use Windows text to speech?

Click Start, click Control Panel, and then double-click Speech. On the Text-to-Speech tab, click Preview Voice to hear the currently selected voice. The text is spoken and the words are highlighted as they are spoken. If the speakers are working properly, you will hear the spoken words.


1 Answers

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

    • refer to How to text-to-speech output using command-line?
    • commandline function using google TTS (wget to mp3->mplayer)
    • command using google with mplayer directly:
      • /usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=Hello%20World&tl=en";
  • on Raspberry Pi, Win, OSX (or any remote) using Node-Red

    npm i node-red-contrib-sysmessage

like image 176
BananaAcid Avatar answered Sep 23 '22 17:09

BananaAcid