node.js安装wx-voice转换silk和mp3

《node.js安装wx-voice转换silk和mp3》要点:
本文介绍了node.js安装wx-voice转换silk和mp3,希望对您有用。如果有疑问,可以联系我们。

一、安装mingw,这里安装到D:\MinGw。

然后安装gcc,g++,

c:\> mingw-get install gcc

二、先安装 WxVoice:

$ npm install wx-voice --save

$ npm install wx-voice -g

$ wx-voice compile

三、转换:

保存为w.js

const WxVoice = require('wx-voice');
var voice = new WxVoice();
voice.on(error, (err) => {});

voice.encode(
       mp3.mp3, mp3_output.silk, { format: silk },       (file) => console.log(file));

执行:

M:\apacheWeb\214_jiqirenIpad>node w.js

M:\apacheWeb\214_jiqirenIpad\node_modules\wx-voice\index.js:352

            throw new Error(Silk SDK not found,make sure you compiled using co

mmand: wx-voice compile);

            ^

Error: Silk SDK not found,make sure you compiled using command: wx-voice compil

e

    at WxVoice._checkDependencies (M:\apacheWeb\214_jiqirenIpad\node_modules\wx-

voice\index.js:352:19)

    at new WxVoice (M:\apacheWeb\214_jiqirenIpad\node_modules\wx-voice\index.js:

34:14)

    at Object.<anonymous> (M:\apacheWeb\214_jiqirenIpad\w.js:2:13)

    at Module._compile (module.js:652:30)

    at Object.Module._extensions..js (module.js:663:10)

    at Module.load (module.js:565:32)

    at tryModuleLoad (module.js:505:12)

    at Function.Module._load (module.js:497:3)

    at Function.Module.runMain (module.js:693:10)

    at startup (bootstrap_node.js:188:16)

M:\apacheWeb\214_jiqirenIpad>wx-voice compile

[wx-voice]  ⠏ Running command: compile-1

[wx-voice]  compile-1 success

[wx-voice]  ⠼ Running command: compile-2

[wx-voice]  ERROR  d:\MinGw\bin\ar.exe: creating libSKP_SILK_SDK.a

【解决方案】去https://github.com/linzhesheng/AudConvertMp3下载,提取其中libSKP_SILK_SDK.a放在D:\MinGw\lib下

M:\apacheWeb\214_jiqirenIpad>wx-voice compile

[wx-voice]  ⠏ Running command: compile-1

[wx-voice]  compile-1 success

[wx-voice]  ⠏ Running command: compile-2

[wx-voice]  compile-2 success

相关阅读:

https://kn007.net/topics/batch-convert-silk-v3-audio-files-to-mp3-in-windows/

相关文章

这篇文章主要介绍“基于nodejs的ssh2怎么实现自动化部署”的...
本文小编为大家详细介绍“nodejs怎么实现目录不存在自动创建...
这篇“如何把nodejs数据传到前端”文章的知识点大部分人都不...
本文小编为大家详细介绍“nodejs如何实现定时删除文件”,内...
这篇文章主要讲解了“nodejs安装模块卡住不动怎么解决”,文...
今天小编给大家分享一下如何检测nodejs有没有安装成功的相关...