{"id":31277,"date":"2024-11-25T09:24:50","date_gmt":"2024-11-25T01:24:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/31277\/"},"modified":"2024-11-25T09:24:50","modified_gmt":"2024-11-25T01:24:50","slug":"%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%ae%9e%e7%8e%b0%e8%af%ad%e9%9f%b3%e8%af%86%e5%88%ab%e7%bb%8f%e9%aa%8c%e5%88%86%e4%ba%ab","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/31277\/","title":{"rendered":"\u5c0f\u7a0b\u5e8f\u5b9e\u73b0\u8bed\u97f3\u8bc6\u522b\u7ecf\u9a8c\u5206\u4eab"},"content":{"rendered":"<p>\u4e4b\u524d\u5199\u4e86\u4e2a\u5de5\u5177\u578b\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\uff08find\u5468\u8fb9\uff09\uff0c\u91cc\u9762\u7528\u5230\u4e86\u8bed\u97f3\u8bc6\u522b\u6280\u672f\u3002\u672c\u6587\u5c31\u4e3b\u8981\u548c\u5927\u5bb6\u5206\u4eab\u5c0f\u7a0b\u5e8f\u5b9e\u73b0\u8bed\u97f3\u8bc6\u522b\u7ecf\u9a8c\uff0c\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u5927\u5bb6\u3002<\/p>\n<p><strong>\u63a5\u53e3\u9884\u89c8<\/strong> &nbsp;<\/p>\n<p>\u901a\u8fc7\u9605\u8bfb\u4e86\u89e3\u79d1\u5927\u8baf\u98de\u63a5\u53e3\u6587\u6863\u3001\u5c0f\u7a0b\u5e8f\u63a5\u53e3\u5f00\u53d1\u6587\u6863\u4ee5\u53ca\u5bf9\u540e\u7aefThinkPhp\u6846\u67b6\u7684\u5b66\u4e60\uff0c\u6211\u6574\u7406\u4e86\u5982\u4e0b\u5f00\u53d1\u6b65\u9aa4:<\/p>\n<ul>\n<li>\n<p>\u6ce8\u518c\u79d1\u5927\u8baf\u98de\u8d26\u53f7(<strong>\u56fd\u4eba\u7684\u9a84\u50b2\uff0c\u5168\u7403\u9886\u5148\u7684\u8bed\u97f3\u8bc6\u522b\u6280\u672f<\/strong>)<\/p>\n<\/li>\n<li>\n<p>\u8fdb\u5165AIUI\u5f00\u653e\u5e73\u53f0\u5728\u5e94\u7528\u7ba1\u7406\u521b\u5efa\u5e94\u7528\u5e76\u8bb0\u5f55APPID\u548cApiKey<\/p>\n<\/li>\n<li>\n<p>\u8fdb\u5165\u5e94\u7528\u914d\u7f6e\uff0c\u914d\u7f6e\u7b26\u5408\u81ea\u5df1\u7684\u60c5\u666f\u6a21\u5f0f\u3001\u8bc6\u522b\u65b9\u5f0f\u548c\u6280\u80fd<\/p>\n<\/li>\n<li>\n<p>\u8fdb\u884c\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5f55\u5236\u9700\u8981\u8bc6\u522b\u7684\u97f3\u9891\uff08\u4e0b\u6709\u8be6\u8ff0\uff09<\/p>\n<\/li>\n<li>\n<p>\u540e\u7aef\u8f6c\u7801\u5f55\u5236\u7684\u97f3\u9891\uff08\u79d1\u5927\u8baf\u98de\u652f\u6301pcm\u3001wav\uff09\uff0c\u63d0\u4ea4\u7ed9\u8bc6\u522b\u63a5\u53e3\uff08\u4e0b\u6709\u8be6\u8ff0\uff09<\/p>\n<\/li>\n<li>\n<p>\u5c0f\u7a0b\u5e8f\u63a5\u5230\u8bc6\u522b\u7ed3\u679c\u8fdb\u884c\u63a5\u4e0b\u6765\u4e1a\u52a1<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u97f3\u9891\u5f55\u5236\u63a5\u53e3<\/strong><\/p>\n<ul>\n<li>\n<p>wx.startRecord()\u548cwx.stopRecord()<\/p>\n<\/li>\n<\/ul>\n<blockquote><p>\n  wx.startRecord()\u548cwx.stopRecord()\u63a5\u53e3\u4e5f\u53ef\u4ee5\u6ee1\u8db3\u9700\u6c42\uff0c\u4f46\u4ece1.6.0 \u7248\u672c\u5f00\u59cb\u4e0d\u518d\u88ab\u5fae\u4fe1\u56e2\u961f\u7ef4\u62a4\u3002\u5efa\u8bae\u4f7f\u7528\u80fd\u529b\u66f4\u5f3a\u7684 wx.getRecorderManager \u63a5\u53e3\u3002\u8be5\u63a5\u53e3\u83b7\u53d6\u5230\u7684\u97f3\u9891\u683c\u5f0f\u4e3asilk\u3002 &nbsp;silk\u662fwebm\u683c\u5f0f\u901a\u8fc7base64\u7f16\u7801\u540e\u7684\u7ed3\u679c\uff0c\u6211\u4eec\u89e3\u7801\u540e\u9700\u8981\u5c06webm\u8f6c\u6362\u6210pcm\u3001wav\n<\/p><\/blockquote>\n<ul>\n<li>\n<p>wx.getRecorderManager()<\/p>\n<\/li>\n<\/ul>\n<blockquote><p>\n  \u76f8\u5bf9wx.startRecord()\u63a5\u53e3\uff0c\u8be5\u63a5\u53e3\u63d0\u4f9b\u7684\u80fd\u529b\u66f4\u4e3a\u5f3a\u5927(\u8be6\u60c5)\uff0c\u53ef\u4ee5\u6682\u505c\u5f55\u97f3\u4e5f\u53ef\u4ee5\u7ee7\u7eed\u5f55\u97f3\uff0c\u6839\u636e\u81ea\u5df1\u9700\u6c42\u8bbe\u7f6e\u7f16\u7801\u7801\u7387\uff0c\u5f55\u97f3\u901a\u9053\u6570\uff0c\u91c7\u6837\u7387\u3002\u6700\u8ba9\u4eba\u5f00\u5fc3\u7684\u662f\u53ef\u4ee5\u6307\u5b9a\u97f3\u9891\u683c\u5f0f\uff0c\u6709\u6548\u503c aac\/mp3\u3002\u4e0d\u597d\u7684\u662fwx.getRecorderManager()\u57281.6.0\u624d\u5f00\u59cb\u88ab\u652f\u6301\u3002\u5f53\u7136\u5982\u679c\u4f60\u8981\u517c\u5bb9\u4f4e\u7aef\u5fae\u4fe1\u7528\u6237\u9700\u8981\u4f7f\u7528wx.startRecord()\u505a\u517c\u5bb9\u5904\u7406\u3002\n<\/p><\/blockquote>\n<ul>\n<li>\n<p>\u4e8b\u4ef6\u76d1\u542c\u7ec6\u8282<\/p>\n<\/li>\n<\/ul>\n<pre>\/\/ wxjs:\r\n\r\nconst recorderManager = wx.getRecorderManager()\r\nrecorderManager.onStart(() =&gt; {\r\n    \/\/\u5f00\u59cb\u5f55\u5236\u7684\u56de\u8c03\u65b9\u6cd5\r\n})\r\n\/\/\u5f55\u97f3\u505c\u6b62\u51fd\u6570\r\nrecorderManager.onStop((res) =&gt; {\r\n  const { tempFilePath } = res;\r\n  \/\/\u4e0a\u4f20\u5f55\u5236\u7684\u97f3\u9891\r\n  wx.uploadFile({\r\n    url: app.d.hostUrl + '\/Api\/Index\/wxupload', \/\/\u4ec5\u4e3a\u793a\u4f8b\uff0c\u975e\u771f\u5b9e\u7684\u63a5\u53e3\u5730\u5740\r\n    filePath: tempFilePath,\r\n    name: 'viceo',\r\n    success: function (res) {\r\n        console.log(res);\r\n    }\r\n  })\r\n})\r\n\r\nPage({\r\n    \/\/\u6309\u4e0b\u6309\u94ae--\u5f55\u97f3\r\n  startHandel: function () {\r\n    console.log(\"\u5f00\u59cb\")\r\n    recorderManager.start({\r\n      duration: 10000\r\n    })\r\n  },\r\n  \/\/\u677e\u5f00\u6309\u94ae\r\n  endHandle: function () {\r\n    console.log(\"\u7ed3\u675f\")\r\n    \/\/\u89e6\u53d1\u5f55\u97f3\u505c\u6b62\r\n    recorderManager.stop()\r\n  }\r\n})\r\n\r\n\/\/wxml:\r\n&lt;view bindtouchstart='startHandel' bindtouchend='endHandle' class=\"tapview\"&gt;\r\n    &lt;text&gt;{{text}}&lt;\/text&gt;\r\n&lt;\/view&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u97f3\u9891\u8f6c\u6362<\/strong><\/p>\n<p>\u6211\u8fd9\u8fb9\u540e\u7aef\u4f7f\u7528php\u7684\u5f00\u6e90\u6846\u67b6thinkphp,\u5f53\u7136node\u3001java\u3001python\u7b49\u540e\u7aef\u8bed\u8a00\u90fd\u53ef\u4ee5\uff0c\u4f60\u6839\u636e\u81ea\u5df1\u7684\u559c\u597d\u548c\u80fd\u529b\u6765\u3002\u60f3\u505a\u597d\u97f3\u9891\u8f6c\u7801\u6211\u4eec\u5c31\u8981\u501f\u52a9\u97f3\u89c6\u9891\u8f6c\u7801\u5de5\u5177ffmpeg\u3001avconv\uff0c\u5b83\u4eec\u90fd\u4f9d\u8d56\u4e8egcc\u3002\u5b89\u88c5\u8fc7\u7a0b\u5927\u5bb6\u53ef\u4ee5\u81ea\u884c\u767e\u5ea6\uff0c\u6216\u8005\u5173\u6ce8\u5e95\u90e8\u7684\u6587\u7ae0\u94fe\u63a5\u3002<\/p>\n<pre>&lt;?php\r\nnamespace ApiController;\r\nuse ThinkController;\r\nclass IndexController extends Controller {\r\n    \r\n    \/\/\u97f3\u9891\u4e0a\u4f20\u7f16\u89e3\u7801\r\n    public function wxupload(){\r\n        $upload_res=$_FILES['viceo'];\r\n        $tempfile = file_get_contents($upload_res['tmp_name']);\r\n        $wavname = substr($upload_res['name'],0,strripos($upload_res['name'],\".\")).\".wav\";\r\n        $arr = explode(\",\", $tempfile);\r\n        $path = 'Aduio\/'.$upload_res['name'];\r\n        \r\n        if ($arr &amp;&amp; !empty(strstr($tempfile,'base64'))){\r\n            \/\/\u5fae\u4fe1\u6a21\u62df\u5668\u5f55\u5236\u7684\u97f3\u9891\u6587\u4ef6\u53ef\u4ee5\u76f4\u63a5\u5b58\u50a8\u8fd4\u56de\r\n            file_put_contents($path, base64_decode($arr[1]));\r\n            $data['path'] = $path;\r\n            apiResponse(\"success\",\"\u8f6c\u7801\u6210\u529f\uff01\",$data);\r\n        }else{\r\n            \/\/\u624b\u673a\u5f55\u97f3\u6587\u4ef6\r\n            $path = 'Aduio\/'.$upload_res['name'];\r\n            $newpath = 'Aduio\/'.$wavname;\r\n            file_put_contents($path, $tempfile);\r\n            chmod($path, 0777);\r\n            $exec1 = \"avconv -i \/home\/wwwroot\/mapxcx.kanziqiang.top\/$path -vn -f wav \/home\/wwwroot\/mapxcx.kanziqiang.top\/$newpath\";\r\n            exec($exec1,$info,$status);\r\n            chmod($newpath, 0777);\r\n            if ( !empty($tempfile) &amp;&amp; $status == 0 ) {\r\n                $data['path'] = $newpath;\r\n                apiResponse(\"success\",\"\u8f6c\u7801\u6210\u529f\uff01\",$data);\r\n            }\r\n        }\r\n        apiResponse(\"error\",\"\u53d1\u751f\u672a\u77e5\u9519\u8bef\uff01\");\r\n    }\r\n    \/\/json\u6570\u636e\u8fd4\u56de\u65b9\u6cd5\u5c01\u88c5\r\n    function apiResponse($flag = 'error', $message = '',$data = array()){\r\n        $result = array('flag'=&gt;$flag,'message'=&gt;$message,'data'=&gt;$data);\r\n        print json_encode($result);exit;\r\n    }\r\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u8c03\u7528\u8bc6\u522b\u63a5\u53e3<\/strong><\/p>\n<p>\u5f53\u6211\u4eec\u628a\u6587\u4ef6\u51c6\u5907\u597d\u4e4b\u540e\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u53ef\u4ee5\u5c06base64\u7f16\u7801\u4e4b\u540e\u7684\u97f3\u9891\u6587\u4ef6\u901a\u8fc7api\u63a5\u53e3\u8bf7\u6c42\u4f20\u8f93\u8fc7\u53bb\u3002\u671f\u95f4\u6211\u4eec\u8981\u6ce8\u610f\u4e25\u683c\u6309\u7167\u6587\u6863\u4e2d\u6240\u8bf4\u7684\u89c4\u8303\u4f20\u8f93\uff0c\u5426\u5219\u5c06\u9020\u6210\u4e0d\u53ef\u77e5\u7684\u7ed3\u679c\u3002<\/p>\n<pre>&lt;?php\r\nnamespace ApiController;\r\nuse ThinkController;\r\nclass IndexController extends Controller {\r\n    public function _initialize(){\r\n    }\r\n    \/\/\u5c01\u88c5\u6570\u636e\u8bf7\u6c42\u65b9\u6cd5\r\n    public function httpsRequest($url,$data = null,$xparam){\r\n        $curl = curl_init();\r\n        curl_setopt($curl, CURLOPT_URL, $url);\r\n        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\r\n        curl_setopt($curl, CURLOPT_HEADER, 0);\r\n        $Appid = \"\";\/\/\u5f00\u653e\u5e73\u53f0\u7684appid\r\n        $Appkey = \"\";\/\/\u5f00\u653e\u5e73\u53f0\u7684Appkey\r\n        $curtime = time();\r\n        $CheckSum = md5($Appkey.$curtime.$xparam.$data);\r\n        $headers = array(\r\n            'X-Appid:'.$Appid,\r\n            'X-CurTime:'.$curtime,\r\n            'X-CheckSum:'.$CheckSum,\r\n            'X-Param:'.$xparam,\r\n            'Content-Type:'.'application\/x-www-form-urlencoded; charset=utf-8'\r\n            );\r\n        curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\r\n        if (!empty($data)){\r\n            curl_setopt($curl, CURLOPT_POST, 1);\r\n            curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\r\n        }\r\n        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n        $output = curl_exec($curl);\r\n        curl_close($curl);\r\n        return $output;\r\n    }\r\n    \/\/\u8bf7\u6c42\u63a5\u53e3\u6570\u636e\u5904\u7406\r\n    public function getVoice($path){\r\n        $d = base64_encode($path);\r\n        $url = \"https:\/\/api.xfyun.cn\/v1\/aiui\/v1\/voice_semantic\";\r\n        $xparam = base64_encode( json_encode(array('scene' =&gt; 'main','userid'=&gt;'user_0001',\"auf\"=&gt;\"16k\",\"aue\"=&gt;\"raw\",\"spx_fsize\"=&gt;\"60\" )));\r\n        $data = \"data=\".$d;\r\n        $res = $this-&gt;httpsRequest($url,$data,$xparam);\r\n        if(!empty($res) &amp;&amp; $res['code'] == 00000){\r\n            apiResponse(\"success\",\"\u8bc6\u522b\u6210\u529f\uff01\",$res);\r\n        }else{\r\n            apiResponse(\"error\",\"\u8bc6\u522b\u5931\u8d25\uff01\");\r\n        }\r\n    }\r\n    \/\/\u6570\u636e\u8fd4\u56de\u5c01\u88c5\r\n    function apiResponse($flag = 'error', $message = '',$data = array()){\r\n        $result = array('flag'=&gt;$flag,'message'=&gt;$message,'data'=&gt;$data);\r\n        print json_encode($result);exit;\r\n    }\r\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5230\u8fd9\u91cc\u57fa\u672c\u5c31\u5b8c\u6210\u4e86\u3002\u4ee5\u4e0a\u4ee3\u7801\u662f\u7ecf\u8fc7\u6574\u7406\u4e4b\u540e\u7684\uff0c\u5e76\u4e0d\u4e00\u5b9a\u80fd\u591f\u6ee1\u8db3\u5404\u4f4d\u7684\u5b9e\u9645\u5f00\u53d1\u9700\u6c42\u3002\u5982\u679c\u53d1\u73b0\u4e0d\u5f53\u4e4b\u5904\u6b22\u8fce\u5fae\u4fe1\u4ea4\u6d41\uff08xiaoqiang0672\uff09\u3002<\/p>\n<p>\u60f3\u770b\u5b9e\u9645\u6848\u4f8b\u7684\u53ef\u4ee5\u5fae\u4fe1\u626b\u7801<br \/>&#8211;<br \/><span><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/054\/025\/076a0b0c2648b8970985129bbc46fc1a-0.jpg\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u5b9e\u73b0\u8bed\u97f3\u8bc6\u522b\u7ecf\u9a8c\u5206\u4eab\u63d2\u56fe\" alt=\"\u5c0f\u7a0b\u5e8f\u5b9e\u73b0\u8bed\u97f3\u8bc6\u522b\u7ecf\u9a8c\u5206\u4eab\u63d2\u56fe\" \/><\/span><\/p>\n<p>\u76f8\u5173\u63a8\u8350\uff1a<\/p>\n<\/p>\n<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5c0f\u7a0b\u5e8f\u5b9e\u73b0\u8bed\u97f3\u8bc6\u522b\u7ecf\u9a8c\u5206\u4eab\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e4b\u524d\u5199\u4e86\u4e2a\u5de5\u5177\u578b\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\uff08find\u5468\u8fb9\uff09\uff0c\u91cc\u9762\u7528\u5230\u4e86\u8bed\u97f3\u8bc6\u522b\u6280\u672f\u3002\u672c\u6587\u5c31\u4e3b\u8981\u548c\u5927\u5bb6\u5206\u4eab\u5c0f\u7a0b\u5e8f\u5b9e\u73b0\u8bed\u97f3\u8bc6\u522b\u7ecf\u9a8c\uff0c\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u5927\u5bb6\u3002 \u63a5\u53e3\u9884\u89c8 &nbsp; \u901a\u8fc7\u9605\u8bfb\u4e86\u89e3\u79d1\u5927\u8baf\u98de\u63a5\u53e3\u6587\u6863\u3001\u5c0f\u7a0b\u5e8f\u63a5\u53e3\u5f00\u53d1\u6587\u6863\u4ee5\u53ca\u5bf9\u540e\u7aefThinkPhp\u6846\u67b6\u7684\u5b66\u4e60\uff0c\u6211\u6574\u7406\u4e86\u5982\u4e0b\u5f00\u53d1\u6b65\u9aa4: \u6ce8\u518c\u79d1\u5927\u8baf\u98de\u8d26\u53f7(\u56fd\u4eba\u7684\u9a84\u50b2\uff0c\u5168\u7403\u9886\u5148\u7684\u8bed\u97f3\u8bc6\u522b\u6280\u672f) \u8fdb\u5165AIUI\u5f00\u653e\u5e73\u53f0\u5728\u5e94\u7528\u7ba1\u7406\u521b\u5efa\u5e94\u7528\u5e76\u8bb0\u5f55APPID\u548cApiKey \u8fdb\u5165\u5e94\u7528\u914d\u7f6e\uff0c\u914d\u7f6e\u7b26\u5408\u81ea\u5df1\u7684\u60c5\u666f\u6a21\u5f0f\u3001\u8bc6\u522b\u65b9\u5f0f\u548c\u6280\u80fd \u8fdb\u884c\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u5f55\u5236\u9700\u8981\u8bc6\u522b\u7684\u97f3\u9891\uff08\u4e0b\u6709\u8be6\u8ff0\uff09 \u540e\u7aef\u8f6c\u7801\u5f55\u5236\u7684\u97f3\u9891\uff08\u79d1\u5927\u8baf\u98de\u652f\u6301pcm\u3001wav\uff09\uff0c\u63d0\u4ea4\u7ed9\u8bc6\u522b\u63a5\u53e3\uff08\u4e0b\u6709\u8be6\u8ff0\uff09 \u5c0f\u7a0b\u5e8f\u63a5\u5230\u8bc6\u522b\u7ed3\u679c\u8fdb\u884c\u63a5\u4e0b\u6765\u4e1a\u52a1 \u97f3\u9891\u5f55\u5236\u63a5\u53e3 wx.startRecord()\u548cwx.stopRecord() wx.startRecord()\u548cwx.stopRecord()\u63a5\u53e3\u4e5f\u53ef\u4ee5\u6ee1\u8db3\u9700\u6c42\uff0c\u4f46\u4ece1.6.0 \u7248\u672c\u5f00\u59cb\u4e0d\u518d\u88ab\u5fae\u4fe1\u56e2\u961f\u7ef4\u62a4\u3002\u5efa\u8bae\u4f7f\u7528\u80fd\u529b\u66f4\u5f3a\u7684 wx.getRecorderManager \u63a5\u53e3\u3002\u8be5\u63a5\u53e3\u83b7\u53d6\u5230\u7684\u97f3\u9891\u683c\u5f0f\u4e3asilk\u3002 &nbsp;silk\u662fwebm\u683c\u5f0f\u901a\u8fc7base64\u7f16\u7801\u540e\u7684\u7ed3\u679c\uff0c\u6211\u4eec\u89e3\u7801\u540e\u9700\u8981\u5c06webm\u8f6c\u6362\u6210pcm\u3001wav wx.getRecorderManager() \u76f8\u5bf9wx.startRecord()\u63a5\u53e3\uff0c\u8be5\u63a5\u53e3\u63d0\u4f9b\u7684\u80fd\u529b\u66f4\u4e3a\u5f3a\u5927(\u8be6\u60c5)\uff0c\u53ef\u4ee5\u6682\u505c\u5f55\u97f3\u4e5f\u53ef\u4ee5\u7ee7\u7eed\u5f55\u97f3\uff0c\u6839\u636e\u81ea\u5df1\u9700\u6c42\u8bbe\u7f6e\u7f16\u7801\u7801\u7387\uff0c\u5f55\u97f3\u901a\u9053\u6570\uff0c\u91c7\u6837\u7387\u3002\u6700\u8ba9\u4eba\u5f00\u5fc3\u7684\u662f\u53ef\u4ee5\u6307\u5b9a\u97f3\u9891\u683c\u5f0f\uff0c\u6709\u6548\u503c aac\/mp3\u3002\u4e0d\u597d\u7684\u662fwx.getRecorderManager()\u57281.6.0\u624d\u5f00\u59cb\u88ab\u652f\u6301\u3002\u5f53\u7136\u5982\u679c\u4f60\u8981\u517c\u5bb9\u4f4e\u7aef\u5fae\u4fe1\u7528\u6237\u9700\u8981\u4f7f\u7528wx.startRecord()\u505a\u517c\u5bb9\u5904\u7406\u3002 \u4e8b\u4ef6\u76d1\u542c\u7ec6\u8282 \/\/ wxjs: const recorderManager = wx.getRecorderManager() recorderManager.onStart(() =&gt; { \/\/\u5f00\u59cb\u5f55\u5236\u7684\u56de\u8c03\u65b9\u6cd5 }) \/\/\u5f55\u97f3\u505c\u6b62\u51fd\u6570 recorderManager.onStop((res) =&gt; { const { tempFilePath } = res; \/\/\u4e0a\u4f20\u5f55\u5236\u7684\u97f3\u9891 wx.uploadFile({ url: app.d.hostUrl + &#8216;\/Api\/Index\/wxupload&#8217;, \/\/\u4ec5\u4e3a\u793a\u4f8b\uff0c\u975e\u771f\u5b9e\u7684\u63a5\u53e3\u5730\u5740 filePath: tempFilePath, name: &#8216;viceo&#8217;, success: function [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-31277","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=31277"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31277\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=31277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=31277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=31277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}