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

npm run audio - command error #43

Closed
leodak opened this issue Sep 28, 2020 · 3 comments
Closed

npm run audio - command error #43

leodak opened this issue Sep 28, 2020 · 3 comments

Comments

@leodak
Copy link

leodak commented Sep 28, 2020

gulp audio

[21:54:22] Using gulpfile ~/Downloads/DuckHunt-JS-master/gulpfile.js
[21:54:22] Starting 'audio'...
[21:54:22] Starting ''...
(node:20657) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[21:54:22] '' errored after 16 ms
[21:54:22] Error: spawn ffmpeg 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)
[21:54:22] 'audio' errored after 19 ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] audio: gulp audio
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] audio script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Above is error

@IAluI
Copy link

IAluI commented Dec 4, 2020

@leodak

  1. install ffmpeg https://ffmpeg.org/download.html
  2. add path to folder with ffmpeg.exe to environment variable "Path" (in other system you must do similar operation, ask google about it)
  3. rewrite task 'audio':
gulp.task('audio', gulp.parallel(function(cb) {
  var files = glob.sync('./src/assets/sounds/*.mp3');
  var outputPath = './dist/audio';
  var opts = {
    output: outputPath,
    path: './',
    format: 'howler2',
    'export': 'ogg,mp3',
    loop: ['quacking', 'sniff']
  };

  return audiosprite(files, opts, function(err, obj) {
    if (err) {
      console.error(err);
    }

    return fs.writeFile('./dist/audio' + '.json', JSON.stringify(obj, null, 2), cb);
  });
}));
  1. profit!

@MattSurabian
Copy link
Owner

Sorry for the delayed response here and thanks for jumping in @IAluI ! I've updated the master branch to account for the new function signature and add the callback.

@MattSurabian
Copy link
Owner

@leodak Updated to fix this issue here edbb71e

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

3 participants