{"id":1359,"date":"2019-03-05T21:07:28","date_gmt":"2019-03-05T12:07:28","guid":{"rendered":"https:\/\/yuis-programming.com\/?p=1359"},"modified":"2021-10-16T17:27:42","modified_gmt":"2021-10-16T08:27:42","slug":"powershell%e3%81%a7ttstext-to-speech","status":"publish","type":"post","link":"https:\/\/yuis-programming.com\/?p=1359","title":{"rendered":"Powershell\u3067\u30c6\u30ad\u30b9\u30c8\u3092\u8aad\u307f\u4e0a\u3052(TTS)"},"content":{"rendered":"<p>Windows\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u8a00\u8a9ePowershell\u3067\u3001\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u4e0a\u3052(TTS, text-to-speech)\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002cmd.exe\u304b\u3089\u3082powershell\u3092\u547c\u3073\u51fa\u3057\u3066\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code>Add-Type -AssemblyName System.speech\n$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer\n$speak.Speak('Hello...')\n<\/code><\/pre>\n<p>or<\/p>\n<pre><code>Add-Type -AssemblyName System.speech\n$tts = New-Object System.Speech.Synthesis.SpeechSynthesizer\n\n$Phrase = @\"\n&lt;speak version=\"1.0\" xmlns=\"http:\/\/www.w3.org\/2001\/10\/synthesis\"\n    xml:lang=\"en-US\"&gt;\n    &lt;voice xml:lang=\"en-US\"&gt;\n    &lt;prosody rate=\"1\"&gt;\n        &lt;p&gt;This is $(bash -ic \"date '+%H:%M'\")&lt;\/p&gt;\n    &lt;\/prosody&gt;\n    &lt;\/voice&gt;\n&lt;\/speak&gt;\n\"@\n$tts.SpeakSsml($Phrase)\n\n<\/code><\/pre>\n<p>python\u3067tts\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3044\u304f\u3064\u304b\u3042\u3063\u305f\u3093\u3067\u3059\u3051\u3069pip install\u3057\u3066\u3082\u306a\u305c\u304b\u4f7f\u3048\u306a\u304f\u3066\u8a70\u3093\u3067\u305f\u306e\u3067\u4ed5\u65b9\u306a\u304fPS\u3067\u3084\u308b\u3053\u3068\u306b\u3057\u305f\u3051\u3069\u5b58\u5916\u697d\u3067\u767a\u97f3\u3082\u6700\u9ad8\u3067\u3059\u306d\u3002<\/p>\n<p><a href=\"https:\/\/www.pdq.com\/blog\/powershell-text-to-speech-examples\/\">PowerShell: Text-to-Speech Examples &#8211; PDQ.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u8a00\u8a9ePowershell\u3067\u3001\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u4e0a\u3052(TTS, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"acf":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Rxwo-lV","_links":{"self":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1359"}],"collection":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1359"}],"version-history":[{"count":2,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1359\/revisions"}],"predecessor-version":[{"id":2976,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1359\/revisions\/2976"}],"wp:attachment":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}