Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How convert mp3 audio files to silk v3 (QQ & WeChat voice files) files #2

Open
igit-cn opened this issue Sep 20, 2017 · 31 comments
Open

Comments

@igit-cn
Copy link

igit-cn commented Sep 20, 2017

No description provided.

@Ang-YC
Copy link
Owner

Ang-YC commented Sep 20, 2017

先安装 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 (开发工具)

@igit-cn
Copy link
Author

igit-cn commented Sep 22, 2017

Marvellous!Thank you!

@igit-cn igit-cn closed this as completed Sep 22, 2017
@igit-cn
Copy link
Author

igit-cn commented Sep 22, 2017

The type of WeChat audio file is amr,
default
,it donesn‘t work!

@igit-cn igit-cn reopened this Sep 22, 2017
@Ang-YC
Copy link
Owner

Ang-YC commented Sep 22, 2017

虽然微信的后缀是 amr 但是格式是 silk,可以试看:
wx-voice encode msg.mp3 msg.amr silk

@igit-cn
Copy link
Author

igit-cn commented Sep 22, 2017

default

@Ang-YC
Copy link
Owner

Ang-YC commented Sep 22, 2017

有点奇怪,微信录音我都可以双向重复转换的,可以发样本给我看看吗?

@igit-cn
Copy link
Author

igit-cn commented Sep 22, 2017

@Ang-YC
Copy link
Owner

Ang-YC commented Sep 22, 2017

转换没问题呢,可能是你的 ffmpeg 设置上有问题,可以看下 ffmpeg 的输出?
ffmpeg -version

@igit-cn
Copy link
Author

igit-cn commented Sep 22, 2017

default

@Ang-YC
Copy link
Owner

Ang-YC commented Sep 22, 2017

Configuration 为空,可以试看根据这个安装吗?
https://github.com/Ang-YC/wx-voice/blob/master/README.cn.md#installing-ffmpeg

@igit-cn
Copy link
Author

igit-cn commented Sep 22, 2017

Thanks,again!

@igit-cn igit-cn closed this as completed Sep 22, 2017
@igit-cn igit-cn reopened this Sep 22, 2017
@igit-cn igit-cn closed this as completed Sep 22, 2017
@Ang-YC
Copy link
Owner

Ang-YC commented Sep 22, 2017

这个问题解决了吗? =)

@igit-cn
Copy link
Author

igit-cn commented Sep 22, 2017

ffmpeg版本有要求吧

@Ang-YC
Copy link
Owner

Ang-YC commented Sep 22, 2017

那更新后现在已经解决了?

@igit-cn
Copy link
Author

igit-cn commented Sep 23, 2017

Mac上brew install ffmpeg版本3.3.3,转换没有什么问题,但是在centos 7,yum install ffmpeg版本2.6.8,
default,国内阿里yum源支持的最高版本

@igit-cn igit-cn reopened this Sep 23, 2017
@igit-cn
Copy link
Author

igit-cn commented Sep 23, 2017

default
centos 7,ffmpeg 3.3.4,报错!

@Ang-YC
Copy link
Owner

Ang-YC commented Sep 24, 2017

已经制造了同样的问题,确定了是 bug,完成后会更新

@Ang-YC
Copy link
Owner

Ang-YC commented Sep 28, 2017

新版本已经解决了这个问题,可透过下列代码更新

npm install wx-voice@latest --save
npm install wx-voice@latest -g
wx-voice compile

谢谢支持 =)

@Ang-YC
Copy link
Owner

Ang-YC commented Oct 16, 2017

想确认下目前没问题了吧?

@igit-cn
Copy link
Author

igit-cn commented Oct 18, 2017

没问题了,谢谢!

@igit-cn igit-cn closed this as completed Oct 18, 2017
@igit-cn igit-cn reopened this Nov 6, 2017
@igit-cn
Copy link
Author

igit-cn commented Nov 6, 2017

1509932983006
silk转mp3,一直卡住

@igit-cn
Copy link
Author

igit-cn commented Nov 6, 2017

1509934708294

@igit-cn
Copy link
Author

igit-cn commented Nov 6, 2017

mac本机环境,可以转换成功,但是centos 7环境不行

@igit-cn
Copy link
Author

igit-cn commented Nov 6, 2017

image
silk文件

@igit-cn
Copy link
Author

igit-cn commented Nov 6, 2017

_242e2420-803f-4174-a27b-f593e7b2d3de
Ubuntu编译报错

@Ang-YC
Copy link
Owner

Ang-YC commented Nov 6, 2017

这是因为 node.js 版本过旧的问题,需要 Node 6+ 以上才支持 Destructuring (可能过后会想办法让所有 Node 版本都支持),至于该 silk 文档可以发给我电邮看看吗?谢谢 =)

@igit-cn
Copy link
Author

igit-cn commented Nov 6, 2017

哦,方便给个邮箱吗?

@igit-cn
Copy link
Author

igit-cn commented Nov 7, 2017

去掉文件头data:audio/webm;base64,,然后Base64解码,再wx-voice解码,就可以了,但是不知道为什么,MAC环境可以直接wx-voice解码,Centos 7环境就不行

@Ang-YC
Copy link
Owner

Ang-YC commented Nov 7, 2017

电邮在代码里有,或者用百度云也可以
我之前试过 CentOS 7 可以呢,但是待会再试试看

@igit-cn
Copy link
Author

igit-cn commented Nov 7, 2017

语音文件百度云链接:http://pan.baidu.com/s/1miP38es

@Ang-YC
Copy link
Owner

Ang-YC commented Dec 29, 2017

是个文件的 bug,已经在 CentOS 7.3 测试了最新版本 (0.2.1) 没问题了(不好意思拖到现在,但欠东西不好欠过年,哈哈)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants