### Install Audiosprite via npm - Bash Source: https://github.com/tonistiigi/audiosprite/blob/master/README.md This command installs the audiosprite tool globally on your system using npm, the Node.js package manager. A global installation allows you to run the `audiosprite` command directly from your terminal. ```Bash npm install -g audiosprite ``` -------------------------------- ### Install Audiosprite via GitHub npm - Bash Source: https://github.com/tonistiigi/audiosprite/blob/master/README.md Use this command to install the latest version of audiosprite directly from its GitHub repository. This is useful for accessing recent changes or development versions not yet published to the npm registry. ```Bash npm install -g git+https://github.com/tonistiigi/audiosprite.git ``` -------------------------------- ### Run Audiosprite CLI Example - Bash Source: https://github.com/tonistiigi/audiosprite/blob/master/README.md This command demonstrates a typical use case for audiosprite, combining `bg_loop.wav` and all `.mp3` files into a sprite named `mygameaudio`. It also sets the sprite named `bg_loop` to autoplay in the generated JSON. ```Bash audiosprite --autoplay bg_loop --output mygameaudio bg_loop.wav *.mp3 ``` -------------------------------- ### Install FFmpeg Dependencies via Homebrew - Bash Source: https://github.com/tonistiigi/audiosprite/blob/master/README.md On macOS, FFmpeg and its required codecs (like Theora and libvorbis for Ogg support) can be easily installed using the Homebrew package manager. This is a prerequisite for audiosprite to function correctly. ```Bash brew install ffmpeg --with-theora --with-libvorbis ``` -------------------------------- ### Show Audiosprite CLI Help - Bash Source: https://github.com/tonistiigi/audiosprite/blob/master/README.md Execute this command in your terminal to display the available command-line options and usage syntax for the audiosprite tool. It provides a quick reference for all parameters and their default values. ```Bash audiosprite --help ``` -------------------------------- ### Initialize Jukebox Player with JSON - JavaScript Source: https://github.com/tonistiigi/audiosprite/blob/master/README.md This snippet shows how to use the JSON output from audiosprite with the discontinued Jukebox framework. The generated JSON object containing sprite information is passed directly to the `jukebox.Player` constructor to initialize the audio player, after which you can play specific sprites by name. ```JavaScript var settings = {/* JSON generated by audiosprite*/}; ... // This part needs to be in user event callback. var myPlayer = new jukebox.Player(settings); ... myPlayer.play('click'); ``` -------------------------------- ### Generate LimeJS Asset from JSON - Bash Source: https://github.com/tonistiigi/audiosprite/blob/master/README.md If using the LimeJS framework, this command converts the JSON output generated by audiosprite into a `.soy` file that can be included and required within your LimeJS project. This prepares the audio sprite data for use with LimeJS's `AudioMap` class. ```Bash bin/lime.py gensoy path/to/mygameaudio.json ``` -------------------------------- ### Using Audiosprite Node.js API - JavaScript Source: https://github.com/tonistiigi/audiosprite/blob/master/README.md This snippet shows how to integrate audiosprite into a Node.js application using its programmatic API. You require the module, provide an array of input file paths and an options object, and process the resulting sprite data in a callback function. ```JavaScript var audiosprite = require('audiosprite') var files = ['file1.mp3', 'file2.mp3'] var opts = {output: 'result'} audiosprite(files, opts, function(err, obj) { if (err) return console.error(err) console.log(JSON.stringify(obj, null, 2)) }) ``` -------------------------------- ### Play Audio in LimeJS - JavaScript Source: https://github.com/tonistiigi/audiosprite/blob/master/README.md After generating the LimeJS asset, this JavaScript code demonstrates how to load and play specific audio sprites within your LimeJS game. It involves requiring the necessary `AudioMap` class and the generated asset, creating an `AudioMap` instance, and calling the `play` method with the sprite name. ```JavaScript goog.require('lime.audio.AudioMap'); goog.require('lime.ASSETS.mygameaudio.json'); var audio = new lime.audio.AudioMap(lime.ASSETS.mygameaudio.json); ... audio.play('click'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.