如何修复mplayer错误:在node.js中生成mplayer ENOENT错误

时间:2019-05-12 08:53:34

标签: node.js

我正在尝试在node.js中创建通知声音,同时看起来我发现了这个https://www.npmjs.com/package/play-sound 但是当我跑步时 节点play.js,出现以下错误

错误:生成mplayer ENOEN

我从网上下载了mapler和mgp321播放器,但不了解应将这些文件放在哪里,以便play.js使用这些文件? 我正在使用Windows10。


var play = require('../lib/play').Play();

// play with a callback
play.sound('../wavs/sfx/intro.wav', function(){

  // these are all "fire and forget", no callback
  play.sound('../wavs/sfx/alarm.wav');
  play.sound('../wavs/sfx/crinkle.wav');
  play.sound('../wavs/sfx/flush.wav');
  play.sound('../wavs/sfx/ding.wav');
});


声音应该来了,但我得到了

playing=>../wavs/sfx/intro.wav
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn mplayer ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)

0 个答案:

没有答案