Jump to content

Tools to create audiosprites?


kriket
 Share

Recommended Posts

Had a look at this https://github.com/tonistiigi/audiosprite  but its giving me errors on ubuntu. 

 

 

Tried several commands to no avail. Always get the following error.

sudo audiosprite -o mygamesound gold_carts.wav single_nugget.mp3
sudo audiosprite gold_carts.wav single_nugget.mp3
sudo audiosprite --output mygamesound gold_carts.wav single_nugget.mp3
sudo audiosprite mygamesound /home/prince/Desktop/explosion_5.wav /home/prince/Desktop/Win_GameOver.mp3
sudo audiosprite --output mygamesound /home/prince/Desktop/explosion_5.wav /home/prince/Desktop/Win_GameOver.mp3
sudo audiosprite -o mygamesound /home/prince/Desktop/explosion_5.wav /home/prince/Desktop/Win_GameOver.mp3
 
events.js:72        throw er; // Unhandled 'error' event              ^Error: spawn ENOENT    at errnoException (child_process.js:1011:11)    at Process.ChildProcess._handle.onexit (child_process.js:802:34)

This is a time-consuming debug so instead of finding why this is happening, I was wondering if there an easy and simple audiosprite creator out there?

 

 

EDIT - Tried different sound source files as well and still the same error so no issues with sound files. 

Link to comment
Share on other sites

Hi, have you installed ffmpeg? I was solving this yesterday.

 

 If you are on windows, then you can write batch script like this:

setlocalset "PATH=%path%;d:\Utils\FFMPEG\bin"audiosprite --output sfx --export mp3,ogg,m4a,wav --format createjs --bitrate 64 --samplerate 44100 --channels 1 Click.wav Explosion.wav

 This adds path to ffmpge\bin to your PATH environment variable only for script duration. Not sure, how to do it on Ubuntu...

Link to comment
Share on other sites

Hi, have you installed ffmpeg? I was solving this yesterday.

 

 If you are on windows, then you can write batch script like this:

setlocalset "PATH=%path%;d:\Utils\FFMPEG\bin"audiosprite --output sfx --export mp3,ogg,m4a,wav --format createjs --bitrate 64 --samplerate 44100 --channels 1 Click.wav Explosion.wav

 This adds path to ffmpge\bin to your PATH environment variable only for script duration. Not sure, how to do it on Ubuntu...

 

 

I installed ffmpeg on ubuntu via npm. Am giving it a go on windows now. thanks

Link to comment
Share on other sites

  • 2 weeks later...
  • 9 months later...

I've been trying to use this tool to create some audiosprite files but I'm having some issues. I think I have everything installed correctly and the bat file I created, based on the one above works:

audiosprite --output sfx --export mp3,ogg,m4a,wav --format createjs --bitrate 64 --samplerate 44100 --channels 1 creature1.ogg creature2.ogg creature3.ogg

I have quite a lot of sounds that I want to use and it's getting a bit unwieldy so I've been trying to use the javascript method based on the API usage example on the github, so

var audiosprite = require('audiosprite')

var files = ['creature1.ogg', 'creature2.ogg', 'creature3.ogg']
var opts = {output: 'result', export:'mp3,ogg,m4a,wav'}

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

  console.log(JSON.stringify(obj, null, 2))
})

but I'm getting errors:

error:  Error: Error adding file
    at C:\Users\Sam\AppData\Roaming\npm\node_modules\audiosprite\audiosprite.js:267:25

The source files, js file with the above code and the bat file are all in the same folder. I have also tried specifying the full path in the files array, but no dice. I could just keep using the bat file but I'd really prefer to work out what I am doing wrong.

I feel a bit silly asking a question in a year old thread but this seems to be one of the few places discussing how to use it.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...