{"id":663,"date":"2016-08-19T11:16:45","date_gmt":"2016-08-19T02:16:45","guid":{"rendered":"http:\/\/tech.at-iroha.jp\/?p=663"},"modified":"2018-08-17T16:32:55","modified_gmt":"2018-08-17T07:32:55","slug":"%e3%83%96%e3%83%a9%e3%82%a6%e3%82%b6%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8b%e9%8c%b2%e9%9f%b3%e5%8f%8a%e3%81%b3%e9%9f%b3%e5%a3%b0%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ae%e7%94%9f%e6%88%90%e3%80%81","status":"publish","type":"post","link":"https:\/\/tech.at-iroha.jp\/?p=663","title":{"rendered":"\u30d6\u30e9\u30a6\u30b6\u306b\u304a\u3051\u308b\u9332\u97f3\u53ca\u3073\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u3001\u8ee2\u9001"},"content":{"rendered":"<p>\u6700\u8fd1\u3001\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u306e\u9332\u97f3\u3001\u304a\u3088\u3073\u9332\u97f3\u3057\u305f\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u3001\u8ee2\u9001\u306b\u3064\u3044\u3066\u8abf\u67fb\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h2>Chrome, Firefox, Edge \u306b\u304a\u3051\u308b\u9332\u97f3<\/h2>\n<p>Chrome \u306a\u3069\u306e\u30e2\u30c0\u30f3\u30d6\u30e9\u30a6\u30b6\u3067\u306f HTML5 \u306e Web Audio API \u3092\u4f7f\u7528\u3057\u3066\u9332\u97f3\u304c\u53ef\u80fd\u3067\u3059\u3002<br \/>\n(Web Audio API \u3068\u306f\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u97f3\u58f0\u306e\u518d\u751f\u3001\u9332\u97f3\u3092\u884c\u3046 API \u3067\u30e2\u30c0\u30f3\u30d6\u30e9\u30a6\u30b6\u3092\u4e2d\u5fc3\u306b\u5b9f\u88c5\u304c\u9032\u3093\u3067\u3044\u307e\u3059\u3002)<br \/>\n\u5404\u30d6\u30e9\u30a6\u30b6\u306e Web Audio API\u306e\u30b5\u30dd\u30fc\u30c8\u72b6\u6cc1<br \/>\n<a href=\"http:\/\/caniuse.com\/#search=web%20audio\" target=\"_blank\" rel=\"noopener\">http:\/\/caniuse.com\/#search=web%20audio<\/a><\/p>\n<p>\u5177\u4f53\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u69d8\u306a\u30b3\u30fc\u30c9\u3067\u9332\u97f3\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nif (navigator.getUserMedia) {\r\n  var bufferSize = 4096;\r\n  var mediaStreamSource = audioContext.createMediaStreamSource(stream);\r\n  var scriptProcessor = audioContext.createScriptProcessor(bufferSize, 1, 1);\r\n  mediaStreamSource.connect(scriptProcessor);\r\n  audioBufferArray = &#x5B;];\r\n  scriptProcessor.onaudioprocess = function(event){\r\n   var channel = event.inputBuffer.getChannelData(0);\r\n   var buffer = new Float32Array(bufferSize);\r\n   for (var i = 0; i &lt; bufferSize; i++) {\r\n   buffer&#x5B;i] = channel&#x5B;i];\r\n   }\r\n   audioBufferArray.push(buffer);\r\n  }\r\n  scriptProcessor.connect(audioContext.destination);\r\n}\r\nelse\r\n{\r\n  alert('\u3053\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u306fWeb Audio API\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093');\r\n}\r\n<\/pre>\n<p>\u53c2\u8003 <a href=\"https:\/\/developer.mozilla.org\/ja\/docs\/Web\/API\/AudioContext\/createMediaStreamSource\" target=\"_blank\" rel=\"noopener\">https:\/\/developer.mozilla.org\/ja\/docs\/Web\/API\/AudioContext\/createMediaStreamSource<\/a><\/p>\n<p>Firefox \u3067\u306f navigator.getUserMedia\u00a0\u306e\u66ff\u308f\u308a\u306b navigator.webkitGetUserMedia\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n\u9332\u97f3\u3092\u958b\u59cb\u3059\u308b\u3068\u30e6\u30fc\u30b6\u306b\u30de\u30a4\u30af\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306e\u8a31\u53ef\u3092\u6c42\u3081\u308b\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3053\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u3067\u8a31\u53ef\u3092\u884c\u308f\u306a\u3044\u3068\u3001\u9332\u97f3\u3092\u884c\u3046\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/tech.at-iroha.jp\/wp-content\/uploads\/2016\/08\/b3267a05d65ebbdd98cd79c7453df694.png\" alt=\"\" \/><\/p>\n<h2>Internet Explorer 11 \u306b\u304a\u3051\u308b\u9332\u97f3<\/h2>\n<p>Internet Explorer 11 \u3067\u306f Web Audio API \u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001Flash Player \u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nFlash Player \u306b\u306f Microphone \u3068\u3044\u3046\u9332\u97f3\u3092\u884c\u3046\u30af\u30e9\u30b9\u304c\u6a19\u6e96\u3067\u7528\u610f\u3055\u308c\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>Microphone &#8211; AS3<br \/>\n<a href=\"http:\/\/help.adobe.com\/ja_JP\/FlashPlatform\/reference\/actionscript\/3\/flash\/media\/Microphone.html\" target=\"_blank\" rel=\"noopener\">http:\/\/help.adobe.com\/ja_JP\/FlashPlatform\/reference\/actionscript\/3\/flash\/media\/Microphone.html<\/a><\/p>\n<p>\u5177\u4f53\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u69d8\u306a\u30b3\u30fc\u30c9\u306b\u3088\u3063\u3066\u9332\u97f3\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nvar mic:Microphone = Microphone.getMicrophone(); \r\nmic.setSilenceLevel(0, DELAY_LENGTH); \r\nmic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler); \r\nfunction micSampleDataHandler(event:SampleDataEvent):void { \r\n    while(event.data.bytesAvailable)     { \r\n        var sample:Number = event.data.readFloat(); \r\n        soundBytes.writeFloat(sample); \r\n    } \r\n}\r\n<\/pre>\n<p>\u53c2\u8003 : \u30b5\u30a6\u30f3\u30c9\u5165\u529b\u306e\u30ad\u30e3\u30d7\u30c1\u30e3<br \/>\n<a href=\"http:\/\/help.adobe.com\/ja_JP\/as3\/dev\/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d1d.html\" target=\"_blank\" rel=\"noopener\">http:\/\/help.adobe.com\/ja_JP\/as3\/dev\/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d1d.html<\/a><\/p>\n<p>Flash \u306b\u304a\u3044\u3066\u3082 Web Audio API \u3068\u540c\u69d8\u306b\u3001\u30de\u30a4\u30af\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306e\u8a31\u53ef\u3092\u6c42\u3081\u308b\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/tech.at-iroha.jp\/wp-content\/uploads\/2016\/08\/a15190e8f10e3cbbfba19c8795512999.png\" alt=\"\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Chrome, Firefox, Edge \u306b\u304a\u3051\u308b\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u3001\u53ca\u3073\u8ee2\u9001<\/h2>\n<p>Chrome \u306a\u3069\u306e\u30e2\u30c0\u30f3\u30d6\u30e9\u30a6\u30b6\u3067\u306f\u540c\u3058\u624b\u6cd5\u3067WAV\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u3001\u30b5\u30fc\u30d0\u3078\u306e\u8ee2\u9001\u3092\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002\u307e\u305fRecorder.js\u3068\u547c\u3070\u308c\u308b\u9332\u97f3\u3001WAV\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u3092\u884c\u3046\u305f\u3081\u306e JavaScript \u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5b58\u5728\u3057\u3001\u3053\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u6bd4\u8f03\u7684\u7c21\u6f54\u306b\u51e6\u7406\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<br \/>\nrecorder.js<br \/>\n<a href=\"https:\/\/github.com\/mattdiamond\/Recorderjs\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/mattdiamond\/Recorderjs<\/a><\/p>\n<p>\u751f\u6210\u3057\u305f\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u3092\u30b5\u30fc\u30d0\u3078\u8ee2\u9001\u3059\u308b\u306b\u306f jQuery \u306e $.ajax() \u30e1\u30bd\u30c3\u30c9\u306a\u3069\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u203b \u5b9f\u88c5\u4f8b<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nvar fd = new FormData();\r\nfd.append('fname', 'test.wav');\r\nfd.append('data', soundBlob);\r\n\r\n$.ajax({\r\n    type: 'POST',\r\n    url: '\/upload.php',\r\n    data: fd,\r\n    processData: false,\r\n    contentType: false\r\n}).done(function(data) {\r\n       console.log(data);\r\n});\r\n<\/pre>\n<h2>Internet Explorer 11 \u306b\u304a\u3051\u308b\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u3001\u53ca\u3073\u8ee2\u9001<\/h2>\n<p>Internet Explorer 11 \u3067\u306f\u9332\u97f3\u3068\u540c\u69d8\u306b Flash Player \u306e\u6a5f\u80fd\u3092\u4f7f\u3063\u3066WAV\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u3001\u30b5\u30fc\u30d0\u3078\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3092\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u9332\u97f3\u3001WAV\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u3092\u884c\u3046\u305f\u3081\u306e\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306e ActionScript 3.0 \u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5b58\u5728\u3057\u3001\u3053\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u7c21\u6f54\u306b\u51e6\u7406\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u4f7f\u7528\u3057\u305fActionScript 3.0\u30e9\u30a4\u30d6\u30e9\u30ea<br \/>\nMicRecorder<br \/>\n<a href=\"http:\/\/www.bytearray.org\/?p=1858\" target=\"_blank\" rel=\"noopener\">http:\/\/www.bytearray.org\/?p=1858<\/a><\/p>\n<p>\u203b \u5b9f\u88c5\u4f8b<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\/\/ \u9332\u97f3\u306e\u30dc\u30ea\u30e5\u30fc\u30e0\u30ec\u30d9\u30eb\u3092\u8a2d\u5b9a\r\nvar volume:Number = .5;\r\n\/\/ WaveEncoder \u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3066 WAV\u30a8\u30f3\u30b3\u30fc\u30c0\u3092\u751f\u6210\r\nvar wavEncoder:WaveEncoder = new WaveEncoder( volume );\r\n\/\/ MicRecorder \u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3066 \u97f3\u58f0\u30ec\u30b3\u30fc\u30c0\u30fc\u3092\u751f\u6210\r\nvar recorder:MicRecorder = new MicRecorder( wavEncoder );\r\n\/\/ \u9332\u97f3\u958b\u59cb\r\nrecorder.record();\r\n\/\/ \u9332\u97f3\u7d42\u4e86\r\nrecorder.stop();\r\n<\/pre>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Chrome \u306a\u3069\u306e\u30e2\u30c0\u30f3\u30d6\u30e9\u30a6\u30b6\u3067\u306fHTML5 \u306e Web Audio API\u306b\u3066\u9332\u97f3\u3001WAV\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u3001\u8ee2\u9001\u304c\u5b9f\u73fe\u53ef\u80fd\u3067\u3059\u3002\u4f46\u3057\u3001Chrome \u306b\u3064\u3044\u3066\u306fSSL\u63a5\u7d9a\u304c\u5fc5\u9808\u3068\u306a\u308a\u307e\u3059\u3002HTTP\u901a\u4fe1\u6642\u306b\u306f\u30de\u30a4\u30af\u304c\u6709\u52b9\u306b\u306a\u308a\u307e\u305b\u3093\u3002Internet Explorer \u306b\u3064\u3044\u3066\u306f Flash Player \u3092\u4f7f\u7528\u3057\u3066\u5b9f\u73fe\u53ef\u80fd\u3067\u3059\u3002<br \/>\n\u307e\u305f\u3044\u305a\u308c\u306e\u5834\u5408\u306b\u3082\u30de\u30a4\u30af\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306b\u5bfe\u3059\u308b\u30e6\u30fc\u30b6\u306e\u8a31\u53ef\u304c\u5fc5\u8981\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30de\u30a4\u30af\u5229\u7528\u306e\u53ef\u5426<\/h3>\n<table style=\"border-color: #666666; height: 100px; background-color: #fafafa;\" border=\"2\" width=\"600\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\" width=\"222\"><\/td>\n<td style=\"text-align: center;\" width=\"223\">Chrome<\/td>\n<td style=\"text-align: center;\" width=\"198\">Edge<\/td>\n<td style=\"text-align: center;\" width=\"198\">Firefox<\/td>\n<td style=\"text-align: center;\" width=\"206\">IE 11<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" width=\"222\">HTTP\u63a5\u7d9a<\/td>\n<td style=\"text-align: center;\" width=\"223\"><span style=\"color: #ff0000;\">NG<\/span><\/td>\n<td style=\"text-align: center;\" width=\"198\">OK<\/td>\n<td style=\"text-align: center;\" width=\"198\">OK<\/td>\n<td style=\"text-align: center;\" width=\"206\">OK<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" width=\"222\">SSL(https)\u63a5\u7d9a<\/td>\n<td style=\"text-align: center;\" width=\"223\">OK<\/td>\n<td style=\"text-align: center;\" width=\"198\">OK<\/td>\n<td style=\"text-align: center;\" width=\"198\">OK<\/td>\n<td style=\"text-align: center;\" width=\"206\">OK<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u30b5\u30f3\u30d7\u30eb<\/h2>\n<h3>HTML5\u7248 (Chrome, Firefox, Edge \u7528)<\/h3>\n<p>HTTP\u63a5\u7d9a<br \/>\n<a href=\"http:\/\/labs.irohasoft.com\/webaudio\/chrome\/\" target=\"_blank\" rel=\"noopener\">http:\/\/labs.irohasoft.com\/webaudio\/chrome\/<\/a><\/p>\n<p>SSL\u63a5\u7d9a<br \/>\n<a href=\"https:\/\/labs.irohasoft.com\/webaudio\/chrome\/\" target=\"_blank\" rel=\"noopener\">https:\/\/labs.irohasoft.com\/webaudio\/chrome\/<\/a><\/p>\n<h3>Flash\u7248 (Internet Explorer 11 \u7528)<\/h3>\n<p>HTTP\u63a5\u7d9a<br \/>\n<a href=\"http:\/\/labs.irohasoft.com\/webaudio\/ie\/\" target=\"_blank\" rel=\"noopener\">http:\/\/labs.irohasoft.com\/webaudio\/ie\/<\/a><\/p>\n<p>SSL\u63a5\u7d9a<br \/>\n<a href=\"https:\/\/labs.irohasoft.com\/webaudio\/ie\/\" target=\"_blank\" rel=\"noopener\">https:\/\/labs.irohasoft.com\/webaudio\/ie\/<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u3001\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u306e\u9332\u97f3\u3001\u304a\u3088\u3073\u9332\u97f3\u3057\u305f\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u3001\u8ee2\u9001\u306b\u3064\u3044\u3066\u8abf\u67fb\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002 Chrome, Firefox, Edge \u306b\u304a\u3051\u308b\u9332\u97f3 Chrome \u306a\u3069\u306e\u30e2\u30c0\u30f3\u30d6\u30e9\u30a6\u30b6\u3067\u306f HT [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":668,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-663","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html5js"],"_links":{"self":[{"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=\/wp\/v2\/posts\/663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=663"}],"version-history":[{"count":16,"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=\/wp\/v2\/posts\/663\/revisions"}],"predecessor-version":[{"id":940,"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=\/wp\/v2\/posts\/663\/revisions\/940"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=\/wp\/v2\/media\/668"}],"wp:attachment":[{"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.at-iroha.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}