{"id":235,"date":"2021-07-24T08:34:00","date_gmt":"2021-07-24T08:34:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=235"},"modified":"2021-07-24T08:34:00","modified_gmt":"2021-07-24T08:34:00","slug":"235","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/07\/24\/235\/","title":{"rendered":"\u4f7f\u7528\u8bb0\u4e8b\u672c\u5199\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u8bed\u97f3\u7a0b\u5e8f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/07\/1082563428.jpg\" alt=\"sapi.Speak.jpg\" title=\"sapi.Speak.jpg\"><\/p>\n<h3>1.\u6253\u5f00\u8bb0\u4e8b\u672c\u590d\u5236\u5982\u4e0b\u4ee3\u7801\u5230\u6587\u4ef6\u4e2d<\/h3>\n<h3>2.\u53e6\u5b58\u6587\u4ef6\u540d windows_voice.vbs<\/h3>\n<h3>3.\u53cc\u51fb windows_voice.vbs \u7535\u8111\u5c31\u80fd\u548c\u4f60\u5bf9\u8bdd\u4e86<\/h3>\n<pre><code>Dim message, sapi\nMsgBox(\"\u8bf7\u6234\u4e0a\u8033\u673a\u542c\u6211\u8bf4....\")\nmessage = \"\u8fd9\u662f\u5728\u60a8\u7684\u5fae\u8f6f\u89c6\u7a97\u7cfb\u7edf\u4e0a\u8fdb\u884c\u7684\u7b80\u5355\u8bed\u97f3\u6d4b\u8bd5\u3002\"\nSet sapi = CreateObject(\"sapi.spvoice\")\nsapi.Speak message\n<\/code><\/pre>\n<h3>\u4fee\u6539\u53e6\u5b58 readbook.vbs \u5c31\u80fd\u8bfb\u53d6 book.txt\u7684\u5c0f\u8bf4\u4e86<\/h3>\n<pre><code>Dim message, sapi\nMsgBox(\"\u8bf7\u6234\u4e0a\u8033\u673a\u542c\u6211\u8bf4....\")\nmessage = \"\u8fd9\u662f\u5728\u60a8\u7684\u5fae\u8f6f\u89c6\u7a97\u7cfb\u7edf\u4e0a\u8fdb\u884c\u7684\u7b80\u5355\u8bed\u97f3\u6d4b\u8bd5\u3002\"\nSet sapi = CreateObject(\"sapi.spvoice\")\nsapi.Speak message\n\n\nConst ForReading = 1\n\nDim fs, ts\nset fs = CreateObject(\"Scripting.FileSystemObject\")\nset ts = fs.OpenTextFile(\"book.txt\", ForReading)\nDo Until ts.AtEndOfStream\n    message = ts.ReadLine\n    if message &lt;&gt; \"\" Then\n        sapi.Speak message\n    End if\nLoop\nts.Close\nset ts = Nothing\nset fs = Nothing<\/code><\/pre>\n<hr \/>\n<h3>\u672c\u4ee3\u7801\u82f1\u8bed\u539f\u7248<\/h3>\n<pre><code>Dim message, sapi\nMsgBox(\"Please use the headset and listen to what I have to say...\")\nmessage = \"This is a simple voice test on your Microsoft Windows.\"\nSet sapi = CreateObject(\"sapi.spvoice\")\nsapi.Speak message<\/code><\/pre>\n<hr \/>\n<h3>\u597d\u50cf\u8fd8\u53ef\u4ee5\u5e2e\u4f60\u8bfb\u53d6\u90ae\u4ef6\uff0cWin7\u7cfb\u7edf\u6d4b\u8bd5\u6ca1\u6709\u6210\u529f<\/h3>\n<ul>\n<li>\n<p>windows-greetings-voice.vbs<\/p>\n<pre><code>Set Sapi = Wscript.CreateObject(\"SAPI.SpVoice\")\ndim str\n\nif hour(time) &lt; 12 then\n  Sapi.speak \"Good Morning\"\nelse\n  if hour(time) &gt; 12 then\n      if hour(time) &gt; 16 then\n          Sapi.speak \"Good evening\"\n      else\n          Sapi.speak \"Good afternoon\"\n      end if\n  end if\nend if\n\nSapi.speak \"The current day is\"\nSapi.speak date\n\nSapi.speak \"The current time is\"\n\nif hour(time) &gt; 12 then\n  Sapi.speak hour(time)-12\nelse\n  if hour(time) = 0 then\n      Sapi.speak \"12\"\n  else\n      Sapi.speak hour(time)\n  end if\nend if\n\nif minute(time) &lt; 10 then\n  Sapi.speak \"o\"\n\n  if minute(time) &lt; 1 then\n      Sapi.speak \"clock\"\n  else\n      Sapi.speak minute(time)\n  end if\nelse\n  Sapi.speak minute(time)\nend if\nif hour(time) &gt; 12 then\n  Sapi.speak \"P.M.\"\n  else\n      if hour(time) = 0 then\n          if minute(time) = 0 then\n              Sapi.speak \"Midnight\"\n          else\n              Sapi.speak \"A.M.\"\n          end if\n      else\n          if hour(time) = 12 then\n              if minute(time) = 0 then\n                  Sapi.speak \"Noon\"\n          else\n              Sapi.speak \"P.M.\"\n          end if\n      else\n          Sapi.speak \"A.M.\"\n      end if\n  end if\n end if\n\nSapi.speak \"Checking for new messages. Please standby.\"\nWScript.Sleep 2000\n\nSet otl = createobject(\"outlook.application\")\nSet session = otl.getnamespace(\"mapi\")\n\nsession.logon\n  Set inbox = session.getdefaultfolder(6)\n  c = 0\n\n  For Each m In inbox.items\n      If m.unread Then c = c + 1\n  Next\nsession.logoff\n\ns = \"s\"\nIf c = 1 Then s = \"\"\n\nSapi.speak \"You have\" &amp; c &amp; \"unread message\" &amp; s<\/code><\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1.\u6253\u5f00\u8bb0\u4e8b\u672c\u590d\u5236\u5982\u4e0b\u4ee3\u7801\u5230\u6587\u4ef6\u4e2d 2.\u53e6\u5b58\u6587\u4ef6\u540d windows_voice.vbs 3.\u53cc\u51fb w [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[20],"class_list":["post-235","post","type-post","status-publish","format-standard","hentry","category-learn","tag-vbs"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=235"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/235\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}