Releases: joshwcomeau/redux-sounds
Fix error on non-playlist sound end
What's Changed
- Fix error on non-playlist sound end #35
- Upgrade dependencies
Full Changelog: v3.3.0...v3.3.1
Dynamic sounds, playlist, general maintenance
- Add sounds dynamically using actions
- Create playlists!
- Fix issues with looping sounds #26 (thank you @rovenko and @ludgerey)
- Improve test coverage
- Upgrade dependencies
- Add example app
Upgrade dependencies
- Upgraded dependencies, most notably Howler v2.0.15 -> v2.1.2
- Slightly improved test coverage, upgraded test tooling
Support all Howler methods
Redux-sounds now supports all Holwer methods
Maybe breaking change:
action.meta.sound
can be an object
Example before:
meta: {
sound: 'jumps.lowJump'
}
Example after:
meta: {
sound: {
fade: ['jumps.lowJump', 0 , 1, 2]
}
}
Howler v2
This release updates Howler to v2, and with it comes a small breaking change:
Breaking changes:
- Rename
urls
->src
in soundsData (see commit diff)
v1.1.0 - Sprite support
For projects with more than a couple of sounds, a sprite can be used
to save on network requests. Similarly to graphic sprites, a sound
sprite is one long file.
Traditionally this has been a hard thing to implement, but Howler
makes it very simple. I've upgraded redux-sounds to enable this
functionality.
To use, simply attach a sprite
object to your sound data:
const soundData = {
regularSound: 'path/to/sound.mp3',
animalSounds: {
urls: ['path/to/sprite.mp3'],
sprite: {
bear: [0, 1000],
wolf: [1200, 1500],
lynx: [2000, 4500]
}
}
}
The sprite
object takes the name you want to assign to your sounds
as keys, and an array of the start/end time of the sprite, in
milliseconds. In this example, sprite.mp3
has 3 sounds: the first
one starts immediately and lasts 1 second, the second runs from 1.2s
to 1.5s, and the third runs from 2s to 4.5s (lynxes are verbose!)
Then, when you want to trigger this sound effect, separate the sound
name from the sprite name with a period:
dispatch({
type: WOLF_ATTACK,
meta: {
sound: 'animalSounds.wolf'
}
});
And that's it! Happy sprite-ing =)
v1.0.1
Original release was only installable via NPM. Added a UMD build so users can drop it into a project or use on JSbin/JSfiddle.
Added that info to the README, and updated the examples to use Redux v3.1.0's spiffy new store enhancer style.
v1.0.0
First release!
Moved core Howler integration logic into a separate file so it could be tested.