https://github.com/netgfx/Phaser-SoundManager
A small sound-manager for easily use and parse sounds from assetPacks
https://github.com/netgfx/Phaser-SoundManager
Last synced: 7 months ago
JSON representation
A small sound-manager for easily use and parse sounds from assetPacks
- Host: GitHub
- URL: https://github.com/netgfx/Phaser-SoundManager
- Owner: netgfx
- License: mit
- Created: 2016-02-24T07:34:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-11-15T17:33:37.000Z (over 9 years ago)
- Last Synced: 2025-08-17T04:33:37.494Z (10 months ago)
- Language: JavaScript
- Size: 273 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-phaser - Sound Manager - A small sound-manager for easily use and parse sounds from assetPacks (Uncategorized / Uncategorized)
README
# Phaser-SoundManager
A small sound-manager for easily use and parse sounds from assetPacks
View the *files.json* file for an example of the assetPack, then instansiate the sound-manager like this:
```
var soundManager = new SoundManager(gameObject);
soundManager.setupSounds(); // initialize
```
And call functions like:
```
soundManager.playSound("somesound");
or
soundManager.somesound();
// Stop Sound
soundManager.stopSound("mainSong");
// play sound with loop, and volume parameters
soundManager.playSound("mainMenu", true, 0.5);
```
## API
* playSound(key)
* soundkeyname()
* stopSound(key)
* playSound(key, loop, volume)
* stopAllSounds()
* getSound(key) // returns the sound object