Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/HenrikJoreteg/SoundEffectManager
A simple sound effect manager for playing sounds using the awesome HTML 5 Web Audio API
https://github.com/HenrikJoreteg/SoundEffectManager
Last synced: about 1 month ago
JSON representation
A simple sound effect manager for playing sounds using the awesome HTML 5 Web Audio API
- Host: GitHub
- URL: https://github.com/HenrikJoreteg/SoundEffectManager
- Owner: HenrikJoreteg
- Created: 2012-11-30T09:36:34.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-09-05T11:53:51.000Z (over 9 years ago)
- Last Synced: 2024-09-25T23:11:57.495Z (3 months ago)
- Language: JavaScript
- Size: 367 KB
- Stars: 6
- Watchers: 4
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-web-effect - SoundEffectManager - A simple sound effect manager for playing sounds using the awesome HTML 5 Web Audio API (🚀 A series of exquisite and compact web page cool effects / Audio Effect)
- fucking-awesome-web-effect - SoundEffectManager - A simple sound effect manager for playing sounds using the awesome HTML 5 Web Audio API (🚀 A series of exquisite and compact web page cool effects / Audio Effect)
README
# SoundEffectManager
Is just that. It's a simple sound effect manager for playing sounds using the awesome HTML 5 Web Audio API.
If you think I'm talking about `` tags, go read this: http://www.html5rocks.com/en/tutorials/webaudio/intro/
It's significantly better than `` tags for several reasons:
- You don't have to create a tag for each sound you want to play
- You can multiplex an effect without having to create duplicate tags
- You can also control volume and add other effectsPart of the [Ampersand.js toolkit](http://ampersandjs.com) for building clientside applications.
## Installing
`npm install sound-effect-manager`
## Using it
```js
// just init the sound effect manager
var SoundEffectManager = require('sound-effect-manager');var sm = new SoundEffectManager();
// load some files by passing it a url and a name
sm.loadFile('taps.mp3', 'taps');
sm.loadFile('rocket.wav', 'rocket');// then play the sounds like so:
sm.play('rocket');// or play a sound in looping mode:
sm.play('taps', true);// and to stop a loop:
sm.stop('taps');// that's it!
```## License
MIT
## Credits
Built (rather hastily) by [@HenrikJoreteg](http://twitter.com/henrikjoreteg) for use in [And Bang](http://andbang.com). Which you should totally check out if you work with a team, for anything, ever.