{"id":292,"date":"2026-02-08T16:41:44","date_gmt":"2026-02-08T07:41:44","guid":{"rendered":"https:\/\/socialakiba.com\/?p=292"},"modified":"2026-02-10T05:55:36","modified_gmt":"2026-02-09T20:55:36","slug":"292","status":"publish","type":"post","link":"https:\/\/socialakiba.com\/?p=292","title":{"rendered":"unreal \u304b\u3089 voicevox \u3092\u3057\u3083\u3079\u3089\u305b\u308b"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">voicevox \u3092\u7acb\u3061\u4e0a\u3052\u308b\u3068 rest api \u30b5\u30fc\u30d0\u30fc\uff08localhost:50021\uff09\u304c\u5e38\u99d0\u3059\u308b\u306e\u3067\u3001\u305d\u3053\u3078\u6587\u5b57\u5217\u3068\u8a71\u8005\uff08\u305a\u3093\u3060\u3082\u3093\u3068\u304b\u56db\u56fd\u3081\u305f\u3093\u306a\u3069\uff09\u3092\u6e21\u305b\u3070\u305d\u306e\u6587\u5b57\u5217\u3092\u3057\u3083\u3079\u3089\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002unreal \u304b\u3089 voicevox \u306e rest api \u30b5\u30fc\u30d0\u30fc\u3078 varest \u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u901a\u3058\u3066\u76f4\u63a5\u30a2\u30af\u30bb\u30b9\u3059\u308c\u3070\u826f\u3055\u305d\u3046\u306b\u601d\u3048\u308b\u306e\u3060\u304c\u3001\u305d\u306e\u5f8c voicevox \u304c\u751f\u6210\u3057\u305f wav \u30d5\u30a1\u30a4\u30eb\u3092\u9cf4\u3089\u3059\u3068\u3044\u3046\u51e6\u7406\u3082\u884c\u3046\u5fc5\u8981\u304c\u3042\u308b\u3002\u3053\u306e\u90e8\u5206\u306e\u3053\u307e\u3054\u307e\u3068\u3057\u305f\u4f5c\u696d\u3092 blueprint \u3067\u66f8\u304f\u306e\u306f\u96e3\u3057\u3044\u3002wav\u30d5\u30a1\u30a4\u30eb\u3092windows\u3067\u518d\u751f\u3059\u308b\u3068\u3044\u3046\u305d\u308c\u3060\u3051\u306e\u5358\u7d14\u4f5c\u696d\u306b\u3057\u3066\u3082\u3001powershell \u304b\u3089\u547c\u3076\u306e\u304c\u4e00\u756a\u5b89\u5168\u78ba\u5b9f\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u3053\u3067 powershell \u3067 rest api \u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3066\u3066\u3001unreal \u306f\u305d\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u3044\u3063\u305f\u3093\u30c7\u30fc\u30bf\u3092\u9001\u308a\u3001\u305d\u3053\u304b\u3089 ruby \u306a\u308a python \u306a\u308a\u5225\u306e powershell \u306a\u308a\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u547c\u3073\u51fa\u3057\u3066\u3001voicevox \u306e rest api \u30b5\u30fc\u30d0\u30fc\u3092\u9593\u63a5\u7684\u306b\u547c\u3073\u51fa\u3057\u305f\u308a wav\u30d5\u30a1\u30a4\u30eb\u3092\u518d\u751f\u3059\u308b\u306e\u304c\u4e00\u756a\u3088\u304b\u308d\u3046\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u3063\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u79c1\u306f ruby \u304c\u597d\u304d\u306a\u306e\u3067\u3001\u3067\u304d\u308b\u3060\u3051 ruby \u3067\u66f8\u3051\u308b\u3068\u3053\u308d\u306f ruby \u3067\u66f8\u304d\u305f\u3044\u3068\u601d\u3063\u305f\u3002python \u306f\u7d50\u5c40\u4f7f\u308f\u305a\u306b\u6e08\u3093\u3060\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306e ruby \u30b9\u30af\u30ea\u30d7\u30c8\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306e\u5f15\u6570\u306b\u6587\u5b57\u5217\u3092\u6e21\u3057\u3066 voicevox \u30b5\u30fc\u30d0\u30fc\u3092\u547c\u3073\u51fa\u3057\u6700\u7d42\u7684\u306b powershell \u30b9\u30af\u30ea\u30d7\u30c8\u3067 voicevox \u304c\u751f\u6210\u3057\u305f wav\u30d5\u30a1\u30a4\u30eb\u3092\u518d\u751f\u3059\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">voicevox1.rb <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>require 'net\/http'\nrequire 'uri'\nrequire 'json'\n\ndef speak(text, speaker)\n  puts text, speaker\n  uri = URI.parse(\"http:\/\/localhost:50021\/audio_query\")\n  uri.query = URI.encode_www_form({ \"text\" =&gt; text, \"speaker\" =&gt; speaker })\n  headers = {\n    \"Content-Type\" =&gt; \"application\/json\",\n    \"User-Agent\" =&gt; \"vox-client:0.1\",\n  }\n  response = Net::HTTP.post(uri, \"\", headers)\n  case response\n  when Net::HTTPSuccess\n    result = JSON.parse(response.body)\n  else\n    puts \"audio query error: #{response}\"\n  end\n  uri = URI.parse(\"http:\/\/localhost:50021\/synthesis\")\n  uri.query = URI.encode_www_form({ \"speaker\" =&gt; speaker })\n  response = Net::HTTP.post(uri, response.body, headers)\n  if response.code == '200'\n    File.open(\"output#{speaker}.wav\", \"wb\") do |f|\n      f.write(response.body)\n    end\n  else\n    puts \"synthesis response error\"\n  end\nend\n\nquery_text = ARGV&#91;0]\nspeak(query_text, 1)\n# powershell \u3067 output*.wav \u3092\u9cf4\u3089\u3059\nsystem(\"powershell -ExecutionPolicy Bypass -command .\\\\sound1.ps1\")<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u3057\u3066\u6b21\u306e powershell \u30b9\u30af\u30ea\u30d7\u30c8 sraserv02.ps1 \u306f unreal \u304b\u3089\u547c\u3073\u51fa\u3059 rest api \u30b5\u30fc\u30d0\u30fc\u3067\u3042\u308a\u3001unreal \u304b\u3089\u6e21\u3055\u308c\u305f\u6587\u5b57\u5217\u3092\u305d\u306e\u90fd\u5ea6 ruby \u30b9\u30af\u30ea\u30d7\u30c8\u306b\u6e21\u3059\u3068\u3044\u3046\u3060\u3051\u306e\u3082\u306e\u3067\u3042\u308b\u3002\u3058\u3083\u3042\u6700\u521d\u304b\u3089 rest api \u30b5\u30fc\u30d0\u30fc\u3082 ruby \u3067\u66f8\u3044\u3066\u3057\u307e\u3048\u3070\u3088\u304b\u3063\u305f\u3093\u3058\u3083\u306a\u3044\u306e\u3068\u601d\u3046\u304c\u3001\u3082\u3046\u52d5\u3044\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3068\u308a\u3042\u3048\u305a\u4eca\u306e\u3068\u3053\u308d\u306f\u3053\u308c\u3067\u3088\u3057\u3068\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$port = 6001\n$prefix = \"http:\/\/localhost:$port\/\"\n$text_encoding = &#91;System.Text.Encoding]::UTF8\n\n$listener = New-Object System.Net.HttpListener\n$listener.Prefixes.Add($prefix)\n$listener.Start()\n\nWrite-Host \"REST API Server listening on $prefix\"\nWrite-Host \"Press Ctrl+C to stop.\"\n\ntry {\n  while ($true) {\n    $context  = $listener.GetContext()\n    $request  = $context.Request\n    $response = $context.Response\n\n    $path = $request.Url.AbsolutePath\n    $method = $request.HttpMethod\n\n    Write-Host \"$method $path\"\n\n    $result = $null\n    $status = 200\n\n    if ($method -eq \"POST\" -and $path -eq \"\/talk\") {\n      # POST \/talk\n      # {\"message\": \"string to talk\" }\n      $reader = New-Object IO.StreamReader($request.InputStream, $text_encoding)\n      $body = $reader.ReadToEnd()\n      $reader.Close()\n      $result = $body | ConvertFrom-Json\n    } else {\n      $status = 404\n      $result = @{ error = \"Not found\" }\n    }\n        \n    Write-Host $result.message\n    # ruby \u3067 voicevox \u306b\u8a00\u8449\u3092\u9001\u308b\n    ruby voicevox1.rb $result.message\n  }\n}\nfinally {\n  $listener.Stop()\n  $listener.Close()\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3067\u3001\u6700\u5f8c\u306f\u305f\u3060\u5358\u306bwav\u30d5\u30a1\u30a4\u30eb\u3092\u518d\u751f\u3059\u308b\u3060\u3051\u306e powershell \u30b9\u30af\u30ea\u30d7\u30c8 sound1.ps1\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(New-Object Media.SoundPlayer \"output1.wav\").PlaySync()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">pardon \u306f unreal \u5074\u304b\u3089\u307e\u305a ollama \u306b\u8cea\u554f\u3057\u3066\u305d\u306e\u7b54\u3048\u3092 reply \u306b\u6e21\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest0-scaled.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"578\" src=\"https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest0-1024x578.png\" alt=\"\" class=\"wp-image-304\" srcset=\"https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest0-1024x578.png 1024w, https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest0-300x169.png 300w, https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest0-768x433.png 768w, https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest0-1536x866.png 1536w, https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest0-2048x1155.png 2048w, https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest0-1200x677.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">reply \u306f ruby \u30b9\u30af\u30ea\u30d7\u30c8\u3067\u66f8\u3044\u305f localhost:6001 \u306e rest api \u30b5\u30fc\u30d0\u30fc\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066 voicevox \u3092\u558b\u3089\u305b\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest1-scaled.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"578\" src=\"https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest1-1024x578.png\" alt=\"\" class=\"wp-image-305\" srcset=\"https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest1-1024x578.png 1024w, https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest1-300x169.png 300w, https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest1-768x433.png 768w, https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest1-1536x866.png 1536w, https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest1-2048x1155.png 2048w, https:\/\/socialakiba.com\/wp-content\/uploads\/2026\/02\/varest1-1200x677.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>voicevox \u3092\u7acb\u3061\u4e0a\u3052\u308b\u3068 rest api \u30b5\u30fc\u30d0\u30fc\uff08localhost:50021\uff09\u304c\u5e38\u99d0\u3059\u308b\u306e\u3067\u3001\u305d\u3053\u3078\u6587\u5b57\u5217\u3068\u8a71\u8005\uff08\u305a\u3093\u3060\u3082\u3093\u3068\u304b\u56db\u56fd\u3081\u305f\u3093\u306a\u3069\uff09\u3092\u6e21\u305b\u3070\u305d\u306e\u6587\u5b57\u5217\u3092\u3057\u3083\u3079\u3089\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002unreal  &hellip; <a href=\"https:\/\/socialakiba.com\/?p=292\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;unreal \u304b\u3089 voicevox \u3092\u3057\u3083\u3079\u3089\u305b\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-292","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/socialakiba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=292"}],"version-history":[{"count":6,"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/posts\/292\/revisions"}],"predecessor-version":[{"id":308,"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/posts\/292\/revisions\/308"}],"wp:attachment":[{"href":"https:\/\/socialakiba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/socialakiba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/socialakiba.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}