Comments (31)
先安装 WxVoice:
$ npm install wx-voice --save
$ npm install wx-voice -g
$ wx-voice compile
Command Line 指令:
wx-voice encode input.mp3 output.silk silk
Node.JS 代码:
const WxVoice = require('wx-voice');
var voice = new WxVoice();
voice.on("error", (err) => {});
voice.encode(
"input.mp3", "output.silk", { format: "silk" },
(file) => console.log(file));
微信小程序有3种已知的格式format
:silk 或 silk_amr (真机),webm (开发工具)
from wx-voice.
Marvellous!Thank you!
from wx-voice.
The type of WeChat audio file is amr,
,it donesn‘t work!
from wx-voice.
虽然微信的后缀是 amr 但是格式是 silk,可以试看:
wx-voice encode msg.mp3 msg.amr silk
from wx-voice.
from wx-voice.
有点奇怪,微信录音我都可以双向重复转换的,可以发样本给我看看吗?
from wx-voice.
https://pan.baidu.com/s/1mhHdnrq
from wx-voice.
转换没问题呢,可能是你的 ffmpeg 设置上有问题,可以看下 ffmpeg 的输出?
ffmpeg -version
from wx-voice.
from wx-voice.
Configuration 为空,可以试看根据这个安装吗?
https://github.com/Ang-YC/wx-voice/blob/master/README.cn.md#installing-ffmpeg
from wx-voice.
Thanks,again!
from wx-voice.
这个问题解决了吗? =)
from wx-voice.
ffmpeg版本有要求吧
from wx-voice.
那更新后现在已经解决了?
from wx-voice.
Mac上brew install ffmpeg版本3.3.3,转换没有什么问题,但是在centos 7,yum install ffmpeg版本2.6.8,
,国内阿里yum源支持的最高版本
from wx-voice.
from wx-voice.
已经制造了同样的问题,确定了是 bug,完成后会更新
from wx-voice.
新版本已经解决了这个问题,可透过下列代码更新
npm install wx-voice@latest --save
npm install wx-voice@latest -g
wx-voice compile
谢谢支持 =)
from wx-voice.
想确认下目前没问题了吧?
from wx-voice.
没问题了,谢谢!
from wx-voice.
from wx-voice.
from wx-voice.
mac本机环境,可以转换成功,但是centos 7环境不行
from wx-voice.
from wx-voice.
from wx-voice.
这是因为 node.js 版本过旧的问题,需要 Node 6+ 以上才支持 Destructuring (可能过后会想办法让所有 Node 版本都支持),至于该 silk 文档可以发给我电邮看看吗?谢谢 =)
from wx-voice.
哦,方便给个邮箱吗?
from wx-voice.
去掉文件头data:audio/webm;base64,,然后Base64解码,再wx-voice解码,就可以了,但是不知道为什么,MAC环境可以直接wx-voice解码,Centos 7环境就不行
from wx-voice.
电邮在代码里有,或者用百度云也可以
我之前试过 CentOS 7 可以呢,但是待会再试试看
from wx-voice.
语音文件百度云链接:http://pan.baidu.com/s/1miP38es
from wx-voice.
是个文件的 bug,已经在 CentOS 7.3 测试了最新版本 (0.2.1) 没问题了(不好意思拖到现在,但欠东西不好欠过年,哈哈)
from wx-voice.
Related Issues (13)
- [Warning] Could not recognize this file, force using ffmpeg convert XXX to XXX.wav success, maybe have error. HOT 26
- 可以作用于xcode吗?用于ios开发
- windows下用electron进行调用 Silk SDK not found HOT 1
- 转换silk到mp3格式报错:ERROR decode not successful, file not supported
- 如何快速得到silk的语音时长? HOT 1
- 转成silk后,在转会mp3报错 HOT 3
- nodejs 中的使用, 文件路径是怎么放的呢? HOT 4
- 开发环境在windows下,windows怎么使用 HOT 4
- 能不能加入直接导出PCM格式的选项呢? HOT 4
- 解码用的decoder线程不安全 HOT 6
- 运行报错,提示 Silk SDK not found HOT 2
- 提一个文档错误 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wx-voice.