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

前端之家收集整理的这篇文章主要介绍了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/

猜你在找的Node.js相关文章