{"id":21326,"date":"2014-07-14T15:35:10","date_gmt":"2014-07-14T06:35:10","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=21326"},"modified":"2014-07-14T15:35:11","modified_gmt":"2014-07-14T06:35:11","slug":"voice-text-web-api","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/voice-text-web-api\/","title":{"rendered":"\u30e2\u30e4\u3055\u307e\u30b7\u30e7\u30a6\u541b\u306e\u58f0\u3067\u3057\u3083\u3079\u308a\u307e\u304f\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u300cVoiceText Web API\u300d"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2014\/07\/blogVoiceText-Web-API-1.jpg\" alt=\"VoiceText Web API 1\" title=\"VoiceText Web API-1.jpg\" border=\"0\" width=\"546\" height=\"280\" \/><\/p>\n<p>HOYA\u306e\u97f3\u58f0\u5408\u6210\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2VoiceText\u3092Web\u7d4c\u7531\u3067\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30b5\u30fc\u30d3\u30b9\u300c<a href=\"https:\/\/cloud.voicetext.jp\/webapi\">VoiceText Web API(\u03b2\u7248)<\/a>\u300d\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>VoiceText\u3068\u3044\u3048\u3070\u3001\u4eba\u6c17\u756a\u7d44\u300c\u30e2\u30e4\u30e2\u30e4\u3055\u307e\u3041\uff5e\u305a\uff12\u300d\u306e\u30ca\u30ec\u30fc\u30b7\u30e7\u30f3\u3001<a href=\"http:\/\/voicetext.jp\/show.html\">\u30b7\u30e7\u30a6\u541b<\/a>\u3067\u304a\u99b4\u67d3\u307f\u306e\u9ad8\u54c1\u8cea\u97f3\u58f0\u5408\u6210\u30bd\u30d5\u30c8\u3002\u767b\u9332\u3057\u3066API\u30ad\u30fc\u3055\u3048\u30b2\u30c3\u30c8\u3059\u308c\u3070\u30b7\u30e7\u30a6\u541b\u306b\u304a\u99b4\u67d3\u307f\u306e\u30bb\u30ea\u30d5\u3092\u3057\u3083\u3079\u308a\u307e\u304f\u3089\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h3>curl\u304b\u3089\u4f7f\u3046<\/h3>\n<p>\u307e\u305a<a href=\"https:\/\/cloud.voicetext.jp\/webapi\/api_keys\/new\">API\u5229\u7528\u767b\u9332\u304b\u3089<\/a>API\u30ad\u30fc\u3092\u30b2\u30c3\u30c8\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u57fa\u672c\u7684\u306a\u4f7f\u7528\u6cd5\u306fcurl\u3092\u4f7f\u3063\u3066url\u3092\u53e9\u304f\u3060\u3051\u3002<\/p>\n<pre>\ncurl \"https:\/\/api.voicetext.jp\/v1\/tts\" \\\n     -o \"test.wav\" \\\n     -u \"YOUR_API_KEY:\" \\\n     -d \"text=\u304a\u306f\u3088\u3046\u3054\u3056\u3044\u307e\u3059\" \\\n     -d \"speaker=hikari\"\n<\/pre>\n<p>\u4e0a\u306e\u4f8b\u3060\u3068\u300chikari\u300d\u306e\u58f0\u3067\u300c\u304a\u306f\u3088\u3046\u3054\u3056\u3044\u307e\u3059\u300d\u3068\u558b\u3063\u305f\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u304c\u300ctest.wav\u300d\u306b\u66f8\u304d\u3060\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4e00\u3064\u3060\u3051\u6ce8\u610f\u70b9\u306f\u3001YOUR_API_KEY\u306e\u3042\u3068\u306b\u300c:\u300d\u304c\u5fc5\u8981\u306a\u3053\u3068\u3002curl\u4e0a\u306e\u4ed5\u69d8\u4e0a\u5fc5\u8981\u3068\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h3>Ruby\u304b\u3089\u4f7f\u3046<\/h3>\n<p>VoiceText Web API\u3092Ruby\u304b\u3089\u4f7f\u3046\u305f\u3081\u306eGem\u304c\u4f5c\u3089\u308c\u3066\u3044\u307e\u3059(<a href=\"http:\/\/sho.tdiary.net\/20140709.html\">\u305f\u3060\u306e\u65e5\u8a18<\/a>\u3001<a href=\"https:\/\/github.com\/tdtds\/voice_text_api\">GitHub<\/a>\u3001<a href=\"http:\/\/rubygems.org\/gems\/voice_text_api\">RubyGems<\/a>)\u3002\u3053\u306eGem\u3092\u5229\u7528\u3059\u308c\u3070\u3088\u308a\u7c21\u5358\u306b\u558b\u3089\u305b\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002Mac\u7528\u306b\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305agem\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059(\u307e\u305f\u306fGemfile\u3092\u5229\u7528)\u3002<\/p>\n<pre>\n$ gem install voice_text_api\n<\/pre>\n<p>\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092show.rb\u3068\u3057\u3066\u4fdd\u5b58\u3057\u307e\u3059\u3002YOUR_API_KEY\u306e\u90e8\u5206\u306f\u81ea\u5206\u306eAPI\u30ad\u30fc\u3068\u66f8\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code class=\"ruby\">require 'voice_text_api'\n\nvt = VoiceTextAPI.new('YOUR_API_KEY')\n\n# wav\u5f62\u5f0f\u306e\u623b\u308a\u5024\u304c\u8fd4\u3063\u3066\u304f\u308b\ntext = ARGV.shift || '\u304a\u306f\u3088\u3046\u3054\u3056\u3044\u307e\u3059'\nwav = vt.tts(text, :show)\n\n# wav\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\nfilename = \"sample.wav\"\nFile.open(filename, \"wb\") do |f|\n  f.write wav\nend\n\n# afplay\u30b3\u30de\u30f3\u30c9\u3067wav\u30d5\u30a1\u30a4\u30eb\u3092\u518d\u751f\nsystem(\"\/usr\/bin\/afplay #{filename}\")\n\n<\/code><\/pre>\n<p>\u5b9f\u884c\u3002<\/p>\n<pre>\n$ ruby show.rb\n<\/pre>\n<p>\u5f15\u6570\u3092\u4e0e\u3048\u308c\u3070\u3057\u3083\u3079\u308b\u5185\u5bb9\u3092\u5909\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\n$ ruby show.rb \u304a\u8089\u98df\u3079\u3088\u3046\n<\/pre>\n<h3>\u307e\u3068\u3081<\/h3>\n<p>VoiceText\u306e\u97f3\u58f0\u5408\u6210\u306f\u512a\u79c0\u3067\u805e\u304d\u53d6\u308a\u3084\u3059\u3044\u3067\u3059\u3002\u3055\u3089\u306a\u308b\u5fdc\u7528\u4f8b\u3068\u3057\u3066Twitter\u306e\u30bf\u30a4\u30e0\u30e9\u30a4\u30f3\u3092\u8aad\u307f\u4e0a\u3052\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306a\u3093\u304b\u3082\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"http:\/\/dev.classmethod.jp\/client-side\/voicetext-web-api-read-twitter\/\">VoiceText Web API\u3092\u4f7f\u3063\u3066Twitter\u306ehome_timeline\u3092\u8aad\u307f\u4e0a\u3052\u308b \uff5c Developers.IO<\/a><\/li>\n<\/ul>\n<p>\u4eca\u306e\u3068\u3053\u308d\u30d9\u30fc\u30bf\u7248\u3067\u3001\u4f5c\u6210\u3057\u305f\u97f3\u58f0\u30c7\u30fc\u30bf\u306e\u5546\u7528\u5229\u7528\u3001\u4e8c\u6b21\u5229\u7528\u53ca\u3073\u914d\u5e03\u3059\u308b\u884c\u70ba\u304c\u7981\u6b62\u3055\u308c\u3066\u3044\u308b\u306a\u3069\u6b8b\u5ff5\u306a\u70b9\u3082\u3042\u308a\u307e\u3059\u304c(\u3057\u304b\u305f\u306a\u3044?)\u3001\u4eca\u5f8c\u306e\u767a\u5c55\u306b\u671f\u5f85\u3057\u305f\u3044\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HOYA\u306e\u97f3\u58f0\u5408\u6210\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2VoiceText\u3092Web\u7d4c\u7531\u3067\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30b5\u30fc\u30d3\u30b9\u300cVoiceText Web API(\u03b2\u7248)\u300d\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 VoiceText\u3068\u3044\u3048\u3070\u3001\u4eba\u6c17\u756a\u7d44\u300c\u30e2\u30e4\u30e2\u30e4\u3055\u307e\u3041\uff5e\u305a\uff12\u300d\u306e [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":21325,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[2534,154,2533],"class_list":["post-21326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-program","tag-ruby","tag-voicetext"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/21326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=21326"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/21326\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/21325"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=21326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=21326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=21326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}