如何将微信语音AMR格式通过Node.js转换为MP3格式?
- 内容介绍
- 文章标签
- 相关推荐
本文共计317个文字,预计阅读时间需要2分钟。
javascript使用amr2mp3.js库,通过引入http、https、crypto、fs、express、iconv和bodyParser模块实现文件操作和服务器功能。
amr2mp3.jsvar node.hamm.cn/voice/?id=" + fileName); var url = "www.xxx.com/wechat/sendmsg/text?id=" + request.body.openid + "&msg=" + encodeURIComponent("node.hamm.cn/voice/?id=" + fileName); node.hamm.cn/voice/?id=" + fileName); }); debug("Converting..."); } }); } else { var msg = "Params Missing!"; debug(msg); res.end(msg); } }); app.get('/voice/', function (req, res) { var param = req.query.id; fs.readFile('./voice/' + param + ".mp3", function (err, data) { if (err) { debug("File not found!"); res.end("File not found!"); } else { debug("File Got!"); res.end(data); } }); }); app.get('/*', function (req, res) { var params = req.originalUrl; res.send("
808 Not Found
Nginx&Node本文共计317个文字,预计阅读时间需要2分钟。
javascript使用amr2mp3.js库,通过引入http、https、crypto、fs、express、iconv和bodyParser模块实现文件操作和服务器功能。
amr2mp3.jsvar node.hamm.cn/voice/?id=" + fileName); var url = "www.xxx.com/wechat/sendmsg/text?id=" + request.body.openid + "&msg=" + encodeURIComponent("node.hamm.cn/voice/?id=" + fileName); node.hamm.cn/voice/?id=" + fileName); }); debug("Converting..."); } }); } else { var msg = "Params Missing!"; debug(msg); res.end(msg); } }); app.get('/voice/', function (req, res) { var param = req.query.id; fs.readFile('./voice/' + param + ".mp3", function (err, data) { if (err) { debug("File not found!"); res.end("File not found!"); } else { debug("File Got!"); res.end(data); } }); }); app.get('/*', function (req, res) { var params = req.originalUrl; res.send("

